From 4e47f47d8502575b3ecef1d16c8a71e50fe6da58 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Mon, 20 Apr 2026 02:26:52 +0100 Subject: [PATCH] clippy: fix question_mark lint https://rust-lang.github.io/rust-clippy/master/index.html#question_mark Closes #12658 --- src/builtins/string/replace.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/builtins/string/replace.rs b/src/builtins/string/replace.rs index b7c74f8fe..91ae47f2e 100644 --- a/src/builtins/string/replace.rs +++ b/src/builtins/string/replace.rs @@ -160,12 +160,8 @@ fn interpret_escape(arg: &'args wstr) -> Option { let mut cursor = arg; while !cursor.is_empty() { if cursor.char_at(0) == '\\' { - if let Some(escape_len) = read_unquoted_escape(cursor, &mut result, true, false) { - cursor = cursor.slice_from(escape_len); - } else { - // invalid escape - return None; - } + let escape_len = read_unquoted_escape(cursor, &mut result, true, false)?; + cursor = cursor.slice_from(escape_len); } else { result.push(cursor.char_at(0)); cursor = cursor.slice_from(1);