aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/inheritance.rs
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2018-06-21 12:19:54 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2018-06-21 12:19:54 +0200
commit31b90ccc657a5468de6bdffea8d309f502cd0d07 (patch)
tree5b5689f15dfb2cdcc27eca10ef39212dd18db4f2 /testing/tests/inheritance.rs
parentf05a924c49afb537b624cfe3cbef3a95b13759a2 (diff)
downloadaskama-31b90ccc657a5468de6bdffea8d309f502cd0d07.tar.gz
askama-31b90ccc657a5468de6bdffea8d309f502cd0d07.tar.bz2
askama-31b90ccc657a5468de6bdffea8d309f502cd0d07.zip
Fix formatting with cargo fmt
Diffstat (limited to 'testing/tests/inheritance.rs')
-rw-r--r--testing/tests/inheritance.rs17
1 files changed, 10 insertions, 7 deletions
diff --git a/testing/tests/inheritance.rs b/testing/tests/inheritance.rs
index 6e032ba..2fd69c6 100644
--- a/testing/tests/inheritance.rs
+++ b/testing/tests/inheritance.rs
@@ -23,14 +23,15 @@ fn test_use_base_directly() {
#[test]
fn test_simple_extends() {
- let t = ChildTemplate { _parent: BaseTemplate { title: "Bar" } };
+ let t = ChildTemplate {
+ _parent: BaseTemplate { title: "Bar" },
+ };
assert_eq!(
t.render().unwrap(),
"Bar\n(Bar) Content goes here\nFoo\nCopyright 2017"
);
}
-
pub mod parent {
use askama::Template;
#[derive(Template)]
@@ -41,8 +42,8 @@ pub mod parent {
}
pub mod child {
- use askama::Template;
use super::parent::*;
+ use askama::Template;
#[derive(Template)]
#[template(path = "child.html")]
pub struct ChildTemplate<'a> {
@@ -52,15 +53,15 @@ pub mod child {
#[test]
fn test_different_module() {
- let t = child::ChildTemplate { _parent: parent::BaseTemplate { title: "a" } };
+ let t = child::ChildTemplate {
+ _parent: parent::BaseTemplate { title: "a" },
+ };
assert_eq!(
t.render().unwrap(),
"a\n(a) Content goes here\nFoo\nCopyright 2017"
);
}
-
-
#[derive(Template)]
#[template(path = "nested-base.html")]
struct NestedBaseTemplate {}
@@ -73,6 +74,8 @@ struct NestedChildTemplate {
#[test]
fn test_nested_blocks() {
- let t = NestedChildTemplate { _parent: NestedBaseTemplate {} };
+ let t = NestedChildTemplate {
+ _parent: NestedBaseTemplate {},
+ };
assert_eq!(t.render().unwrap(), "\ndurpy\n");
}