summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-04-28 02:40:36 +0200
committerGitHub <noreply@github.com>2022-04-28 02:40:36 +0200
commit4c628bbb1c266a8513b364dca5ae7e311a1e0777 (patch)
tree6a052354aee525e972374b8a8c1e79833e4c2f20 /compiler/rustc_parse/src
parent6f6fe3e651832796b2454dad5adafe9e21a09498 (diff)
parentf697955c1eb72e3dac6b6aafa411e58cb8d18706 (diff)
downloadrust-4c628bbb1c266a8513b364dca5ae7e311a1e0777.tar.gz
rust-4c628bbb1c266a8513b364dca5ae7e311a1e0777.zip
Rollup merge of #96471 - BoxyUwU:let_else_considered_harmful, r=lcnr
replace let else with `?`

r? `@oli-obk`
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/lexer/unicode_chars.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/lexer/unicode_chars.rs b/compiler/rustc_parse/src/lexer/unicode_chars.rs
index 1d63b79adc5..2e8e23a50eb 100644
--- a/compiler/rustc_parse/src/lexer/unicode_chars.rs
+++ b/compiler/rustc_parse/src/lexer/unicode_chars.rs
@@ -338,9 +338,7 @@ pub(super) fn check_for_substitution<'a>(
     ch: char,
     err: &mut Diagnostic,
 ) -> Option<token::TokenKind> {
-    let Some(&(_u_char, u_name, ascii_char)) = UNICODE_ARRAY.iter().find(|&&(c, _, _)| c == ch) else {
-        return None;
-    };
+    let &(_u_char, u_name, ascii_char) = UNICODE_ARRAY.iter().find(|&&(c, _, _)| c == ch)?;
 
     let span = Span::with_root_ctxt(pos, pos + Pos::from_usize(ch.len_utf8()));