mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 20:42:10 +00:00
fix: Compiler warning about unused map_or
(#7508)
This commit is contained in:
parent
6a4dbd622b
commit
37b7d0f921
1 changed files with 17 additions and 20 deletions
|
@ -67,26 +67,23 @@ pub(crate) fn flask_debug_true(checker: &mut Checker, call: &ExprCall) {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
checker
|
if let Some(binding_id) = checker.semantic().resolve_name(name) {
|
||||||
.semantic()
|
if let Some(Stmt::Assign(StmtAssign { value, .. })) = checker
|
||||||
.resolve_name(name)
|
.semantic()
|
||||||
.map_or((), |binding_id| {
|
.binding(binding_id)
|
||||||
if let Some(Stmt::Assign(StmtAssign { value, .. })) = checker
|
.statement(checker.semantic())
|
||||||
.semantic()
|
{
|
||||||
.binding(binding_id)
|
if let Expr::Call(ExprCall { func, .. }) = value.as_ref() {
|
||||||
.statement(checker.semantic())
|
if checker
|
||||||
{
|
.semantic()
|
||||||
if let Expr::Call(ExprCall { func, .. }) = value.as_ref() {
|
.resolve_call_path(func)
|
||||||
if checker
|
.is_some_and(|call_path| matches!(call_path.as_slice(), ["flask", "Flask"]))
|
||||||
.semantic()
|
{
|
||||||
.resolve_call_path(func)
|
checker
|
||||||
.is_some_and(|call_path| matches!(call_path.as_slice(), ["flask", "Flask"]))
|
.diagnostics
|
||||||
{
|
.push(Diagnostic::new(FlaskDebugTrue, debug_argument.range()));
|
||||||
checker
|
|
||||||
.diagnostics
|
|
||||||
.push(Diagnostic::new(FlaskDebugTrue, debug_argument.range()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue