diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2020-02-08 14:57:27 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2020-02-08 14:57:27 +0100 |
commit | 5d86086f557b72c37a5b50a891bc543b96ae2deb (patch) | |
tree | 13d52cc56cad7e557a477ef4ea675c9c35dc9b85 | |
parent | f123d4eee00323628ae32b1f9b01318402b729fa (diff) | |
download | askama-5d86086f557b72c37a5b50a891bc543b96ae2deb.tar.gz askama-5d86086f557b72c37a5b50a891bc543b96ae2deb.tar.bz2 askama-5d86086f557b72c37a5b50a891bc543b96ae2deb.zip |
Adapt to new warnings and formatting
Diffstat (limited to '')
-rw-r--r-- | askama_actix/tests/basic.rs | 8 | ||||
-rw-r--r-- | askama_shared/src/filters/mod.rs | 2 | ||||
-rw-r--r-- | askama_shared/src/generator.rs | 2 | ||||
-rw-r--r-- | askama_shared/src/input.rs | 1 | ||||
-rw-r--r-- | askama_shared/src/lib.rs | 2 |
5 files changed, 4 insertions, 11 deletions
diff --git a/askama_actix/tests/basic.rs b/askama_actix/tests/basic.rs index f4beff7..4f600fb 100644 --- a/askama_actix/tests/basic.rs +++ b/askama_actix/tests/basic.rs @@ -32,11 +32,9 @@ async fn test_actix_web() { #[actix_rt::test] async fn test_actix_web_responder() { let srv = test::start(|| { - actix_web::App::new().service(web::resource("/").to(|| { - async { - let name = "world".to_owned(); - HelloTemplate { name: &name }.into_response() - } + actix_web::App::new().service(web::resource("/").to(|| async { + let name = "world".to_owned(); + HelloTemplate { name: &name }.into_response() })) }); diff --git a/askama_shared/src/filters/mod.rs b/askama_shared/src/filters/mod.rs index bcc70be..e790a7f 100644 --- a/askama_shared/src/filters/mod.rs +++ b/askama_shared/src/filters/mod.rs @@ -348,7 +348,7 @@ mod tests { fn test_trim() { assert_eq!(trim(&" Hello\tworld\t").unwrap(), "Hello\tworld"); } - + #[test] fn test_truncate() { assert_eq!(truncate(&"hello", &2).unwrap(), "he..."); diff --git a/askama_shared/src/generator.rs b/askama_shared/src/generator.rs index dd33e12..59df687 100644 --- a/askama_shared/src/generator.rs +++ b/askama_shared/src/generator.rs @@ -14,8 +14,6 @@ use std::collections::{HashMap, HashSet}; use std::path::PathBuf; use std::{cmp, hash, mem, str}; -use syn; - pub fn generate<S: std::hash::BuildHasher>( input: &TemplateInput, contexts: &HashMap<&PathBuf, Context, S>, diff --git a/askama_shared/src/input.rs b/askama_shared/src/input.rs index 53718f0..f9d10a4 100644 --- a/askama_shared/src/input.rs +++ b/askama_shared/src/input.rs @@ -3,7 +3,6 @@ use crate::{Config, Syntax}; use std::path::PathBuf; use quote::ToTokens; -use syn; pub struct TemplateInput<'a> { pub ast: &'a syn::DeriveInput, diff --git a/askama_shared/src/lib.rs b/askama_shared/src/lib.rs index 0e8664d..e405439 100644 --- a/askama_shared/src/lib.rs +++ b/askama_shared/src/lib.rs @@ -7,8 +7,6 @@ use std::path::{Path, PathBuf}; #[cfg(feature = "serde")] use serde::Deserialize; -#[cfg(feature = "config")] -use toml; pub use askama_escape::MarkupDisplay; |