aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--askama_derive/src/generator.rs4
-rw-r--r--testing/tests/simple.rs3
2 files changed, 5 insertions, 2 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs
index 6f75318..edde3fe 100644
--- a/askama_derive/src/generator.rs
+++ b/askama_derive/src/generator.rs
@@ -334,7 +334,9 @@ impl<'a> Generator<'a> {
full_anno.append(",");
orig_anno.append(",");
}
- param.to_tokens(&mut full_anno);
+ let mut impl_param = param.clone();
+ impl_param.default = None;
+ impl_param.to_tokens(&mut full_anno);
param.ident.to_tokens(&mut orig_anno);
sep = true;
}
diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs
index 8115fe0..a04b3fa 100644
--- a/testing/tests/simple.rs
+++ b/testing/tests/simple.rs
@@ -110,7 +110,8 @@ fn test_option() {
#[derive(Template)]
#[template(path = "generics.html")]
-struct GenericsTemplate<T: std::fmt::Display, U> where U: std::fmt::Display {
+struct GenericsTemplate<T: std::fmt::Display, U = u8>
+ where U: std::fmt::Display {
t: T,
u: U,
}