self.s.word("<");
self.commasep(Inconsistent, &generic_params, |s, param| {
+ s.print_outer_attributes_inline(¶m.attrs);
+
match param.kind {
ast::GenericParamKind::Lifetime => {
- s.print_outer_attributes_inline(¶m.attrs);
let lt = ast::Lifetime { id: param.id, ident: param.ident };
s.print_lifetime_bounds(lt, ¶m.bounds)
}
ast::GenericParamKind::Type { ref default } => {
- s.print_outer_attributes_inline(¶m.attrs);
s.print_ident(param.ident);
s.print_type_bounds(":", ¶m.bounds);
- match default {
- Some(ref default) => {
- s.s.space();
- s.word_space("=");
- s.print_type(default)
- }
- _ => {}
+ if let Some(ref default) = default {
+ s.s.space();
+ s.word_space("=");
+ s.print_type(default)
}
}
ast::GenericParamKind::Const { ref ty } => {
- s.print_outer_attributes_inline(¶m.attrs);
s.word_space("const");
s.print_ident(param.ident);
s.s.space();