From 8751fa1a9abda9fc7ced6b03315efbd82310830d Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Wed, 15 Feb 2023 11:43:41 +0000 Subject: `if $c:expr { Some($r:expr) } else { None }` =>> `$c.then(|| $r)` --- compiler/rustc_parse_format/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_parse_format/src') diff --git a/compiler/rustc_parse_format/src/lib.rs b/compiler/rustc_parse_format/src/lib.rs index 34a4fd02ea6..2a86738b528 100644 --- a/compiler/rustc_parse_format/src/lib.rs +++ b/compiler/rustc_parse_format/src/lib.rs @@ -835,7 +835,7 @@ impl<'a> Parser<'a> { ); } - if found { Some(cur) } else { None } + found.then(|| cur) } fn suggest_format(&mut self) { -- cgit 1.4.1-3-g733a5