Skip to content

Commit

Permalink
Rollup merge of #68441 - Centril:pprust-as_deref, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
pprust: use as_deref

Some drive-by cleanup.
  • Loading branch information
tmandry committed Jan 22, 2020
2 parents 769ba84 + 7962ccb commit 76db75a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libsyntax/print/pprust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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, _) => {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 76db75a

Please sign in to comment.