diff options
author | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-02-15 11:43:41 +0000 |
---|---|---|
committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-02-16 15:26:00 +0000 |
commit | 8751fa1a9abda9fc7ced6b03315efbd82310830d (patch) | |
tree | f15613d5ca2fa5aadfdde2df1d94907d1798a5bb /compiler/rustc_parse_format | |
parent | af3c8b27266e290cf65704284f6862d0f90ee4fc (diff) | |
download | rust-8751fa1a9abda9fc7ced6b03315efbd82310830d.tar.gz |
`if $c:expr { Some($r:expr) } else { None }` =>> `$c.then(|| $r)`
Diffstat (limited to 'compiler/rustc_parse_format')
-rw-r--r-- | compiler/rustc_parse_format/src/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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) { |