From ac1666d6e224614159e4c12c6f46afadb26b8e8a Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 30 Jul 2024 14:30:25 +0100 Subject: [PATCH] Remove several incorrect uses of `map_callable()` (#12580) --- .../src/analyze/visibility.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/ruff_python_semantic/src/analyze/visibility.rs b/crates/ruff_python_semantic/src/analyze/visibility.rs index 3e107e3af3..1910af249a 100644 --- a/crates/ruff_python_semantic/src/analyze/visibility.rs +++ b/crates/ruff_python_semantic/src/analyze/visibility.rs @@ -28,23 +28,23 @@ pub fn is_classmethod(decorator_list: &[Decorator], semantic: &SemanticModel) -> /// Returns `true` if a function definition is an `@overload`. pub fn is_overload(decorator_list: &[Decorator], semantic: &SemanticModel) -> bool { - decorator_list.iter().any(|decorator| { - semantic.match_typing_expr(map_callable(&decorator.expression), "overload") - }) + decorator_list + .iter() + .any(|decorator| semantic.match_typing_expr(&decorator.expression, "overload")) } /// Returns `true` if a function definition is an `@override` (PEP 698). pub fn is_override(decorator_list: &[Decorator], semantic: &SemanticModel) -> bool { - decorator_list.iter().any(|decorator| { - semantic.match_typing_expr(map_callable(&decorator.expression), "override") - }) + decorator_list + .iter() + .any(|decorator| semantic.match_typing_expr(&decorator.expression, "override")) } /// Returns `true` if a function definition is an abstract method based on its decorators. pub fn is_abstract(decorator_list: &[Decorator], semantic: &SemanticModel) -> bool { decorator_list.iter().any(|decorator| { semantic - .resolve_qualified_name(map_callable(&decorator.expression)) + .resolve_qualified_name(&decorator.expression) .is_some_and(|qualified_name| { matches!( qualified_name.segments(), @@ -86,7 +86,7 @@ pub fn is_property( pub fn is_final(decorator_list: &[Decorator], semantic: &SemanticModel) -> bool { decorator_list .iter() - .any(|decorator| semantic.match_typing_expr(map_callable(&decorator.expression), "final")) + .any(|decorator| semantic.match_typing_expr(&decorator.expression, "final")) } /// Returns `true` if a function is a "magic method".