Avoid adding extra paren with two casts
This commit is contained in:
parent
6a51de0a0a
commit
22baa46f78
@ -1753,7 +1753,11 @@ impl<'a> State<'a> {
|
||||
try!(self.print_literal(&**lit));
|
||||
}
|
||||
ast::ExprCast(ref expr, ref ty) => {
|
||||
try!(self.print_expr_maybe_paren(&**expr));
|
||||
if let ast::ExprCast(..) = expr.node {
|
||||
try!(self.print_expr(&**expr));
|
||||
} else {
|
||||
try!(self.print_expr_maybe_paren(&**expr));
|
||||
}
|
||||
try!(space(&mut self.s));
|
||||
try!(self.word_space("as"));
|
||||
try!(self.print_type(&**ty));
|
||||
|
Loading…
x
Reference in New Issue
Block a user