From 7cefed0ffa1296732d43661dbd4c40f092697e82 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Mon, 15 Apr 2024 12:46:44 +0100 Subject: [PATCH] Equivalent fixes to `ruff_python_stdlib` also --- crates/ruff_python_stdlib/src/typing.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/crates/ruff_python_stdlib/src/typing.rs b/crates/ruff_python_stdlib/src/typing.rs index a917dfa1ca2ca3..bfd8f7f5c04b05 100644 --- a/crates/ruff_python_stdlib/src/typing.rs +++ b/crates/ruff_python_stdlib/src/typing.rs @@ -5,12 +5,13 @@ pub fn is_standard_library_generic(qualified_name: &[&str]) -> bool { matches!( qualified_name, - ["", "dict" | "frozenset" | "list" | "set" | "tuple" | "type"] - | [ - "collections" | "typing" | "typing_extensions", - "ChainMap" | "Counter" - ] - | ["collections" | "typing", "OrderedDict"] + [ + "" | "builtins", + "dict" | "frozenset" | "list" | "set" | "tuple" | "type" + ] | [ + "collections" | "typing" | "typing_extensions", + "ChainMap" | "Counter" + ] | ["collections" | "typing", "OrderedDict"] | ["collections", "defaultdict" | "deque"] | [ "collections", @@ -247,7 +248,7 @@ pub fn is_immutable_non_generic_type(qualified_name: &[&str]) -> bool { pub fn is_immutable_generic_type(qualified_name: &[&str]) -> bool { matches!( qualified_name, - ["", "tuple"] + ["" | "builtins", "tuple"] | [ "collections", "abc", @@ -285,7 +286,7 @@ pub fn is_immutable_generic_type(qualified_name: &[&str]) -> bool { pub fn is_mutable_return_type(qualified_name: &[&str]) -> bool { matches!( qualified_name, - ["", "dict" | "list" | "set"] + ["" | "builtins", "dict" | "list" | "set"] | [ "collections", "Counter" | "OrderedDict" | "defaultdict" | "deque"