updated dependency versions
This commit is contained in:
parent
50dce3a80b
commit
630f7f803a
3 changed files with 713 additions and 540 deletions
1232
Cargo.lock
generated
1232
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -10,12 +10,12 @@ repository = "https://github.com/edward-shen/bunbun"
|
||||||
exclude = ["/aux/"]
|
exclude = ["/aux/"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-web = "2.0"
|
actix-web = "3.0"
|
||||||
actix-rt = "1.0"
|
actix-rt = "1.1"
|
||||||
dirs = "3.0"
|
dirs = "3.0"
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
serde_yaml = "0.8"
|
serde_yaml = "0.8"
|
||||||
handlebars = "2.0"
|
handlebars = "3.5"
|
||||||
hotwatch = "0.4"
|
hotwatch = "0.4"
|
||||||
percent-encoding = "2.1"
|
percent-encoding = "2.1"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
|
15
src/main.rs
15
src/main.rs
|
@ -15,6 +15,7 @@ use error::BunBunError;
|
||||||
use handlebars::{Handlebars, TemplateError};
|
use handlebars::{Handlebars, TemplateError};
|
||||||
use hotwatch::{Event, Hotwatch};
|
use hotwatch::{Event, Hotwatch};
|
||||||
use log::{debug, error, info, trace, warn};
|
use log::{debug, error, info, trace, warn};
|
||||||
|
use simple_logger::SimpleLogger;
|
||||||
use std::cmp::min;
|
use std::cmp::min;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::sync::{Arc, RwLock};
|
use std::sync::{Arc, RwLock};
|
||||||
|
@ -100,16 +101,16 @@ fn init_logger(
|
||||||
let log_level =
|
let log_level =
|
||||||
match min(num_verbose_flags, 3) as i8 - min(num_quiet_flags, 2) as i8 {
|
match min(num_verbose_flags, 3) as i8 - min(num_quiet_flags, 2) as i8 {
|
||||||
-2 => None,
|
-2 => None,
|
||||||
-1 => Some(log::Level::Error),
|
-1 => Some(log::LevelFilter::Error),
|
||||||
0 => Some(log::Level::Warn),
|
0 => Some(log::LevelFilter::Warn),
|
||||||
1 => Some(log::Level::Info),
|
1 => Some(log::LevelFilter::Info),
|
||||||
2 => Some(log::Level::Debug),
|
2 => Some(log::LevelFilter::Debug),
|
||||||
3 => Some(log::Level::Trace),
|
3 => Some(log::LevelFilter::Trace),
|
||||||
_ => unreachable!(), // values are clamped to [0, 3] - [0, 2]
|
_ => unreachable!(), // values are clamped to [0, 3] - [0, 2]
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Some(level) = log_level {
|
if let Some(level) = log_level {
|
||||||
simple_logger::init_with_level(level)?;
|
SimpleLogger::new().with_level(level).init()?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -136,7 +137,7 @@ fn cache_routes(groups: &[RouteGroup]) -> HashMap<String, Route> {
|
||||||
/// Returns an instance with all pre-generated templates included into the
|
/// Returns an instance with all pre-generated templates included into the
|
||||||
/// binary. This allows for users to have a portable binary without needed the
|
/// binary. This allows for users to have a portable binary without needed the
|
||||||
/// templates at runtime.
|
/// templates at runtime.
|
||||||
fn compile_templates() -> Result<Handlebars, TemplateError> {
|
fn compile_templates() -> Result<Handlebars<'static>, TemplateError> {
|
||||||
let mut handlebars = Handlebars::new();
|
let mut handlebars = Handlebars::new();
|
||||||
handlebars.set_strict_mode(true);
|
handlebars.set_strict_mode(true);
|
||||||
handlebars.register_partial("bunbun_version", env!("CARGO_PKG_VERSION"))?;
|
handlebars.register_partial("bunbun_version", env!("CARGO_PKG_VERSION"))?;
|
||||||
|
|
Loading…
Reference in a new issue