unsafety,
polarity,
defaultness,
+ constness,
ref generics,
ref of_trait,
ref self_ty,
self.print_defaultness(defaultness);
self.print_unsafety(unsafety);
self.word_nbsp("impl");
+ self.print_constness(constness);
if !generics.params.is_empty() {
self.print_generic_params(&generics.params);
self.print_expr_as_cond(i);
self.s.space();
self.print_block(then);
- self.print_else(e.as_ref().map(|e| &**e))
+ self.print_else(e.as_deref())
}
// Final `else` block.
ast::ExprKind::Block(ref b, _) => {
self.print_let(pat, scrutinee);
}
ast::ExprKind::If(ref test, ref blk, ref elseopt) => {
- self.print_if(test, blk, elseopt.as_ref().map(|e| &**e));
+ self.print_if(test, blk, elseopt.as_deref())
}
ast::ExprKind::While(ref test, ref blk, opt_label) => {
if let Some(label) = opt_label {
}
}
+ crate fn print_constness(&mut self, s: ast::Constness) {
+ match s {
+ ast::Constness::Const => self.word_nbsp("const"),
+ ast::Constness::NotConst => {}
+ }
+ }
+
crate fn print_is_auto(&mut self, s: ast::IsAuto) {
match s {
ast::IsAuto::Yes => self.word_nbsp("auto"),