Skip to content

Commit

Permalink
remove unnecessary check in to_pep585_generic
Browse files Browse the repository at this point in the history
  • Loading branch information
dylwil3 committed Dec 17, 2024
1 parent cbd1ddb commit 2138d18
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions crates/ruff_python_semantic/src/analyze/typing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ pub fn to_pep585_generic(expr: &Expr, semantic: &SemanticModel) -> Option<Module
.then(|| semantic.resolve_qualified_name(expr))
.flatten()
.and_then(|qualified_name| {
let [module, member] = qualified_name.segments() else {
return None;
};
as_pep_585_generic(module, member).map(|(module, member)| {
as_pep_585_generic(qualified_name.segments()).map(|(module, member)| {
if module.is_empty() {
ModuleMember::BuiltIn(member)
} else {
Expand Down

0 comments on commit 2138d18

Please sign in to comment.