summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorEllen <supbscripter@gmail.com>2022-04-27 08:51:33 +0100
committerEllen <supbscripter@gmail.com>2022-04-27 08:51:33 +0100
commitf697955c1eb72e3dac6b6aafa411e58cb8d18706 (patch)
tree7c4144db47e778adc08e4bd86109d1b4070ce004 /compiler/rustc_parse/src
parentde1026a67b0a3f5d6b61a1f77093af97d4799376 (diff)
downloadrust-f697955c1eb72e3dac6b6aafa411e58cb8d18706.tar.gz
rust-f697955c1eb72e3dac6b6aafa411e58cb8d18706.zip
tut tut tut
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()));