Skip to content

Commit

Permalink
Remove type parameter defaults from impls (fixes #12)
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Mar 8, 2017
1 parent 9397378 commit ed89e5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion askama_derive/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 2 additions & 1 deletion testing/tests/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down

0 comments on commit ed89e5f

Please sign in to comment.