diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-12-07 15:52:26 +0100 |
---|---|---|
committer | Juan Aguilar <mhpoin@gmail.com> | 2018-12-08 21:43:20 +0100 |
commit | 5549f9a3cd94e3cd6700067b1c74194dadb58a0f (patch) | |
tree | fa7037a3d4884a8c76ab7b4bea6d42b0bde0ff91 /askama_shared/src/lib.rs | |
parent | d042c5d758a0b99288b99959d5d98462f18cde65 (diff) | |
download | askama-5549f9a3cd94e3cd6700067b1c74194dadb58a0f.tar.gz askama-5549f9a3cd94e3cd6700067b1c74194dadb58a0f.tar.bz2 askama-5549f9a3cd94e3cd6700067b1c74194dadb58a0f.zip |
Use 2018 edition idioms
Diffstat (limited to 'askama_shared/src/lib.rs')
-rw-r--r-- | askama_shared/src/lib.rs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/askama_shared/src/lib.rs b/askama_shared/src/lib.rs index adb41b5..850cb8b 100644 --- a/askama_shared/src/lib.rs +++ b/askama_shared/src/lib.rs @@ -1,14 +1,8 @@ #![cfg_attr(feature = "cargo-clippy", allow(unused_parens))] - -extern crate askama_escape; -extern crate humansize; -extern crate num_traits; -extern crate serde; #[macro_use] extern crate serde_derive; -#[cfg(feature = "serde_json")] -extern crate serde_json; -extern crate toml; + +use toml; use std::env; use std::fs; @@ -31,14 +25,14 @@ pub struct Config<'a> { } impl<'a> Config<'a> { - pub fn new(s: &str) -> Config { + pub fn new(s: &str) -> Config<'_> { let root = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()); let default_dirs = vec![root.join("templates")]; let mut syntaxes = BTreeMap::new(); syntaxes.insert(DEFAULT_SYNTAX_NAME.to_string(), Syntax::default()); - let raw: RawConfig = + let raw: RawConfig<'_> = toml::from_str(&s).expect(&format!("invalid TOML in {}", CONFIG_FILE_NAME)); let (dirs, default_syntax) = match raw.general { |