aboutsummaryrefslogtreecommitdiffstats
path: root/askama_derive/src/input.rs
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2018-07-02 09:29:50 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2018-07-02 09:29:50 +0200
commit9e95100bf9457da07a1632b4c0bb44b5ecf5d1be (patch)
treee3dffd085833f01bde78b70014d44f8b393d0ec6 /askama_derive/src/input.rs
parent9021c229b72861e4b5fc49260819643eb92d8cb6 (diff)
downloadaskama-9e95100bf9457da07a1632b4c0bb44b5ecf5d1be.tar.gz
askama-9e95100bf9457da07a1632b4c0bb44b5ecf5d1be.tar.bz2
askama-9e95100bf9457da07a1632b4c0bb44b5ecf5d1be.zip
Reorder arms in match for better readability
Diffstat (limited to 'askama_derive/src/input.rs')
-rw-r--r--askama_derive/src/input.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/askama_derive/src/input.rs b/askama_derive/src/input.rs
index 2787084..683c345 100644
--- a/askama_derive/src/input.rs
+++ b/askama_derive/src/input.rs
@@ -86,14 +86,14 @@ impl<'a> TemplateInput<'a> {
let source = source.expect("template path or source not found in attributes");
let path = match (&source, &ext) {
+ (&Source::Path(ref path), None) => path::find_template_from_path(path, None),
+ (&Source::Source(_), Some(ext)) => PathBuf::from(format!("{}.{}", ast.ident, ext)),
(&Source::Path(_), Some(_)) => {
panic!("'ext' attribute cannot be used with 'path' attribute")
}
(&Source::Source(_), None) => {
panic!("must include 'ext' attribute when using 'source' attribute")
}
- (&Source::Path(ref path), None) => path::find_template_from_path(path, None),
- (&Source::Source(_), Some(ext)) => PathBuf::from(format!("{}.{}", ast.ident, ext)),
};
let parent = match ast.data {