Skip to content

Commit

Permalink
Equivalent fixes to ruff_python_stdlib also
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood committed Apr 15, 2024
1 parent 08c5e30 commit 7cefed0
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions crates/ruff_python_stdlib/src/typing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 7cefed0

Please sign in to comment.