Skip to content

Commit 14e6259

Browse files
authored
Rollup merge of rust-lang#68441 - Centril:pprust-as_deref, r=Mark-Simulacrum
pprust: use as_deref Some drive-by cleanup.
2 parents ac3e183 + 7962ccb commit 14e6259

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
@@ -1645,7 +1645,7 @@ impl<'a> State<'a> {
16451645
self.print_expr_as_cond(i);
16461646
self.s.space();
16471647
self.print_block(then);
1648-
self.print_else(e.as_ref().map(|e| &**e))
1648+
self.print_else(e.as_deref())
16491649
}
16501650
// Final `else` block.
16511651
ast::ExprKind::Block(ref b, _) => {
@@ -1949,7 +1949,7 @@ impl<'a> State<'a> {
19491949
self.print_let(pat, scrutinee);
19501950
}
19511951
ast::ExprKind::If(ref test, ref blk, ref elseopt) => {
1952-
self.print_if(test, blk, elseopt.as_ref().map(|e| &**e));
1952+
self.print_if(test, blk, elseopt.as_deref())
19531953
}
19541954
ast::ExprKind::While(ref test, ref blk, opt_label) => {
19551955
if let Some(label) = opt_label {

0 commit comments

Comments
 (0)