updated dependency versions

master
Edward Shen 2020-09-27 15:29:26 -04:00
parent 50dce3a80b
commit 630f7f803a
Signed by: edward
GPG Key ID: 19182661E818369F
3 changed files with 713 additions and 540 deletions

1232
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -10,12 +10,12 @@ repository = "https://github.com/edward-shen/bunbun"
exclude = ["/aux/"]
[dependencies]
actix-web = "2.0"
actix-rt = "1.0"
actix-web = "3.0"
actix-rt = "1.1"
dirs = "3.0"
serde = "1.0"
serde_yaml = "0.8"
handlebars = "2.0"
handlebars = "3.5"
hotwatch = "0.4"
percent-encoding = "2.1"
log = "0.4"

View File

@ -15,6 +15,7 @@ use error::BunBunError;
use handlebars::{Handlebars, TemplateError};
use hotwatch::{Event, Hotwatch};
use log::{debug, error, info, trace, warn};
use simple_logger::SimpleLogger;
use std::cmp::min;
use std::collections::HashMap;
use std::sync::{Arc, RwLock};
@ -100,16 +101,16 @@ fn init_logger(
let log_level =
match min(num_verbose_flags, 3) as i8 - min(num_quiet_flags, 2) as i8 {
-2 => None,
-1 => Some(log::Level::Error),
0 => Some(log::Level::Warn),
1 => Some(log::Level::Info),
2 => Some(log::Level::Debug),
3 => Some(log::Level::Trace),
-1 => Some(log::LevelFilter::Error),
0 => Some(log::LevelFilter::Warn),
1 => Some(log::LevelFilter::Info),
2 => Some(log::LevelFilter::Debug),
3 => Some(log::LevelFilter::Trace),
_ => unreachable!(), // values are clamped to [0, 3] - [0, 2]
};
if let Some(level) = log_level {
simple_logger::init_with_level(level)?;
SimpleLogger::new().with_level(level).init()?;
}
Ok(())
@ -136,7 +137,7 @@ fn cache_routes(groups: &[RouteGroup]) -> HashMap<String, Route> {
/// Returns an instance with all pre-generated templates included into the
/// binary. This allows for users to have a portable binary without needed the
/// templates at runtime.
fn compile_templates() -> Result<Handlebars, TemplateError> {
fn compile_templates() -> Result<Handlebars<'static>, TemplateError> {
let mut handlebars = Handlebars::new();
handlebars.set_strict_mode(true);
handlebars.register_partial("bunbun_version", env!("CARGO_PKG_VERSION"))?;