Pretty print break and continue without redundant space
This commit is contained in:
parent
e6b883c74f
commit
f0f7b8d44a
5 changed files with 11 additions and 16 deletions
|
@ -2135,22 +2135,20 @@ impl<'a> State<'a> {
|
|||
ast::ExprKind::Path(Some(ref qself), ref path) => self.print_qpath(path, qself, true),
|
||||
ast::ExprKind::Break(opt_label, ref opt_expr) => {
|
||||
self.word("break");
|
||||
self.space();
|
||||
if let Some(label) = opt_label {
|
||||
self.print_ident(label.ident);
|
||||
self.space();
|
||||
self.print_ident(label.ident);
|
||||
}
|
||||
if let Some(ref expr) = *opt_expr {
|
||||
self.print_expr_maybe_paren(expr, parser::PREC_JUMP);
|
||||
self.space();
|
||||
self.print_expr_maybe_paren(expr, parser::PREC_JUMP);
|
||||
}
|
||||
}
|
||||
ast::ExprKind::Continue(opt_label) => {
|
||||
self.word("continue");
|
||||
self.space();
|
||||
if let Some(label) = opt_label {
|
||||
self.space();
|
||||
self.print_ident(label.ident);
|
||||
self.space()
|
||||
}
|
||||
}
|
||||
ast::ExprKind::Ret(ref result) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue