aboutsummaryrefslogtreecommitdiffstats
path: root/askama_shared
diff options
context:
space:
mode:
Diffstat (limited to 'askama_shared')
-rw-r--r--askama_shared/src/input.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/askama_shared/src/input.rs b/askama_shared/src/input.rs
index 43aa400..5fc064b 100644
--- a/askama_shared/src/input.rs
+++ b/askama_shared/src/input.rs
@@ -54,11 +54,17 @@ impl<'a> TemplateMeta<'a> {
if let syn::MetaItem::NameValue(ref key, ref val) = *item {
match key.as_ref() {
"path" => if let syn::Lit::Str(ref s, _) = *val {
+ if source.is_some() {
+ panic!("must specify 'source' or 'path', not both");
+ }
source = Some(Source::Path(s.as_ref()));
} else {
panic!("template path must be string literal");
},
"source" => if let syn::Lit::Str(ref s, _) = *val {
+ if source.is_some() {
+ panic!("must specify 'source' or 'path', not both");
+ }
source = Some(Source::Source(s.as_ref()));
} else {
panic!("template source must be string literal");