From f697955c1eb72e3dac6b6aafa411e58cb8d18706 Mon Sep 17 00:00:00 2001 From: Ellen Date: Wed, 27 Apr 2022 08:51:33 +0100 Subject: tut tut tut --- compiler/rustc_parse/src/lexer/unicode_chars.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'compiler/rustc_parse/src') 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 { - 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())); -- cgit 1.4.1-3-g733a5