From 31b90ccc657a5468de6bdffea8d309f502cd0d07 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 21 Jun 2018 12:19:54 +0200 Subject: Fix formatting with cargo fmt --- testing/tests/simple.rs | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'testing/tests/simple.rs') diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs index afd82e9..28a6a0a 100644 --- a/testing/tests/simple.rs +++ b/testing/tests/simple.rs @@ -3,7 +3,6 @@ extern crate askama; use askama::Template; - #[derive(Template)] #[template(path = "simple.html")] struct VariablesTemplate<'a> { @@ -28,7 +27,6 @@ fn test_variables() { ); } - #[derive(Template)] #[template(path = "if.html")] struct IfTemplate { @@ -41,7 +39,6 @@ fn test_if() { assert_eq!(s.render().unwrap(), "true"); } - #[derive(Template)] #[template(path = "else.html")] struct ElseTemplate { @@ -54,7 +51,6 @@ fn test_else() { assert_eq!(s.render().unwrap(), "false"); } - #[derive(Template)] #[template(path = "else-if.html")] struct ElseIfTemplate { @@ -64,11 +60,13 @@ struct ElseIfTemplate { #[test] fn test_else_if() { - let s = ElseIfTemplate { cond: false, check: true }; + let s = ElseIfTemplate { + cond: false, + check: true, + }; assert_eq!(s.render().unwrap(), "checked"); } - #[derive(Template)] #[template(path = "literals.html")] struct LiteralsTemplate {} @@ -79,7 +77,6 @@ fn test_literals() { assert_eq!(s.render().unwrap(), "a"); } - struct Holder { a: usize, } @@ -92,7 +89,9 @@ struct AttrTemplate { #[test] fn test_attr() { - let t = AttrTemplate { inner: Holder { a: 5 } }; + let t = AttrTemplate { + inner: Holder { a: 5 }, + }; assert_eq!(t.render().unwrap(), "5"); } @@ -104,11 +103,12 @@ struct TupleAttrTemplate<'a> { #[test] fn test_tuple_attr() { - let t = TupleAttrTemplate { tuple: ("foo", "bar") }; + let t = TupleAttrTemplate { + tuple: ("foo", "bar"), + }; assert_eq!(t.render().unwrap(), "foobar"); } - struct NestedHolder { holder: Holder, } @@ -121,11 +121,14 @@ struct NestedAttrTemplate { #[test] fn test_nested_attr() { - let t = NestedAttrTemplate { inner: NestedHolder { holder: Holder { a: 5 } } }; + let t = NestedAttrTemplate { + inner: NestedHolder { + holder: Holder { a: 5 }, + }, + }; assert_eq!(t.render().unwrap(), "5"); } - #[derive(Template)] #[template(path = "option.html")] struct OptionTemplate<'a> { @@ -140,11 +143,12 @@ fn test_option() { assert_eq!(none.render().unwrap(), "none"); } - #[derive(Template)] #[template(path = "generics.html")] struct GenericsTemplate - where U: std::fmt::Display { +where + U: std::fmt::Display, +{ t: T, u: U, } @@ -155,7 +159,6 @@ fn test_generics() { assert_eq!(t.render().unwrap(), "a42"); } - #[derive(Template)] #[template(path = "composition.html")] struct CompositionTemplate { @@ -164,11 +167,12 @@ struct CompositionTemplate { #[test] fn test_composition() { - let t = CompositionTemplate { foo: IfTemplate { cond: true } }; + let t = CompositionTemplate { + foo: IfTemplate { cond: true }, + }; assert_eq!(t.render().unwrap(), "composed: true"); } - #[derive(PartialEq, Eq)] enum Alphabet { Alpha, @@ -186,7 +190,6 @@ fn test_path_compare() { assert_eq!(t.render().unwrap(), "true"); } - #[derive(Template)] #[template(source = "{% for i in [\"a\", \"\"] %}{{ i }}{% endfor %}", ext = "txt")] struct ArrayTemplate {} @@ -197,7 +200,6 @@ fn test_slice_literal() { assert_eq!(t.render().unwrap(), "a"); } - #[derive(Template)] #[template(source = " {# foo -#} ", ext = "txt")] struct CommentTemplate {} @@ -208,7 +210,6 @@ fn test_comment() { assert_eq!(t.render().unwrap(), " "); } - #[derive(Template)] #[template(source = "{% if !foo %}Hello{% endif %}", ext = "txt")] struct NegationTemplate { @@ -221,7 +222,6 @@ fn test_negation() { assert_eq!(t.render().unwrap(), "Hello"); } - #[derive(Template)] #[template(source = "{% if foo > -2 %}Hello{% endif %}", ext = "txt")] struct MinusTemplate { -- cgit