diff options
| author | Ellen <supbscripter@gmail.com> | 2022-04-27 08:51:33 +0100 |
|---|---|---|
| committer | Ellen <supbscripter@gmail.com> | 2022-04-27 08:51:33 +0100 |
| commit | f697955c1eb72e3dac6b6aafa411e58cb8d18706 (patch) | |
| tree | 7c4144db47e778adc08e4bd86109d1b4070ce004 /compiler/rustc_parse/src | |
| parent | de1026a67b0a3f5d6b61a1f77093af97d4799376 (diff) | |
| download | rust-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.rs | 4 |
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())); |
