diff --git a/crates/ruff_linter/src/rules/flake8_quotes/rules/check_string_quotes.rs b/crates/ruff_linter/src/rules/flake8_quotes/rules/check_string_quotes.rs index 066d5ab13522a..a479d5396959f 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/rules/check_string_quotes.rs +++ b/crates/ruff_linter/src/rules/flake8_quotes/rules/check_string_quotes.rs @@ -363,7 +363,7 @@ pub(crate) fn check_string_quotes(checker: &mut Checker, string_like: StringLike .indexer() .fstring_ranges() .outermost(string_like.start()) - .is_some_and(|outer_range| outer_range != string_like.range()) + .is_some_and(|outer| outer.start() < string_like.start() && string_like.end() < outer.end()) { return; }