Skip to content

Commit

Permalink
?
Browse files Browse the repository at this point in the history
  • Loading branch information
InSyncWithFoo committed Nov 16, 2024
1 parent 4d24e75 commit dcde503
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::ops::Deref;

use ruff_diagnostics::{Diagnostic, Violation};
use ruff_macros::{derive_message_formats, violation};
use ruff_python_ast::{Expr, ExprAttribute, ExprCall, ExprName};
Expand Down Expand Up @@ -71,10 +69,7 @@ fn tuple_like_call_with_single_argument<'a>(
semantic: &SemanticModel,
call: &'a ExprCall,
) -> Option<&'a Expr> {
let Some((func, positionals)) = func_and_positionals(call) else {
return None;
};

let Some((func, positionals)) = func_and_positionals(call)?;
let func_is = |symbol: &str| semantic.match_builtin_expr(func, symbol);

if !func_is("tuple") && !func_is("list") || positionals.len() != 1 {
Expand All @@ -88,9 +83,7 @@ fn map_call_with_two_arguments<'a>(
semantic: &SemanticModel,
call: &'a ExprCall,
) -> Option<(&'a Expr, &'a Expr)> {
let Some((func, positionals)) = func_and_positionals(call) else {
return None;
};
let Some((func, positionals)) = func_and_positionals(call)?;

if !semantic.match_builtin_expr(func, "map") || positionals.len() != 2 {
return None;
Expand Down

0 comments on commit dcde503

Please sign in to comment.