Skip to content

Commit 7962ccb

Browse files
committed
pprust: use as_deref
1 parent ce361fb commit 7962ccb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libsyntax/print/pprust.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,7 @@ impl<'a> State<'a> {
16431643
self.print_expr_as_cond(i);
16441644
self.s.space();
16451645
self.print_block(then);
1646-
self.print_else(e.as_ref().map(|e| &**e))
1646+
self.print_else(e.as_deref())
16471647
}
16481648
// Final `else` block.
16491649
ast::ExprKind::Block(ref b, _) => {
@@ -1947,7 +1947,7 @@ impl<'a> State<'a> {
19471947
self.print_let(pat, scrutinee);
19481948
}
19491949
ast::ExprKind::If(ref test, ref blk, ref elseopt) => {
1950-
self.print_if(test, blk, elseopt.as_ref().map(|e| &**e));
1950+
self.print_if(test, blk, elseopt.as_deref())
19511951
}
19521952
ast::ExprKind::While(ref test, ref blk, opt_label) => {
19531953
if let Some(label) = opt_label {

0 commit comments

Comments
 (0)