Rollup merge of #68441 - Centril:pprust-as_deref, r=Mark-Simulacrum
pprust: use as_deref Some drive-by cleanup.
This commit is contained in:
commit
14e6259c29
@ -1645,7 +1645,7 @@ impl<'a> State<'a> {
|
||||
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, _) => {
|
||||
@ -1949,7 +1949,7 @@ impl<'a> State<'a> {
|
||||
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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user