From 0efd48e037f54957ba577dfc871753a7e2d28038 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 24 Jul 2019 23:01:04 +0200 Subject: Update formatting --- askama_escape/src/lib.rs | 5 +---- askama_shared/src/lib.rs | 10 ++++++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/askama_escape/src/lib.rs b/askama_escape/src/lib.rs index 62a29da..2771507 100644 --- a/askama_escape/src/lib.rs +++ b/askama_escape/src/lib.rs @@ -77,10 +77,7 @@ pub fn escape(string: &str, escaper: E) -> Escaped<'_, E> where E: Escaper, { - Escaped { - string, - escaper, - } + Escaped { string, escaper } } pub struct Escaped<'a, E> diff --git a/askama_shared/src/lib.rs b/askama_shared/src/lib.rs index 918e356..71543fc 100644 --- a/askama_shared/src/lib.rs +++ b/askama_shared/src/lib.rs @@ -55,7 +55,10 @@ impl<'a> Config<'a> { for raw_s in raw_syntaxes { let name = raw_s.name; - if syntaxes.insert(name.to_string(), Syntax::from(raw_s)).is_some() { + if syntaxes + .insert(name.to_string(), Syntax::from(raw_s)) + .is_some() + { panic!("syntax \"{}\" is already defined", name) } } @@ -404,7 +407,10 @@ mod tests { vec![ (str_set(&["js"]), "::askama::Js".into()), (str_set(&["html", "htm", "xml"]), "::askama::Html".into()), - (str_set(&["md", "none", "txt", "yml", ""]), "::askama::Text".into()), + ( + str_set(&["md", "none", "txt", "yml", ""]), + "::askama::Text".into() + ), (str_set(&["j2", "jinja", "jinja2"]), "::askama::Html".into()), ] ); -- cgit