mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
Remove unused lifetime from UnusedImport type alias (#4874)
This commit is contained in:
parent
8938b2d555
commit
79ae1840af
1 changed files with 6 additions and 6 deletions
|
@ -100,8 +100,8 @@ impl Violation for UnusedImport {
|
|||
}
|
||||
}
|
||||
|
||||
type SpannedName<'a> = (&'a str, &'a TextRange);
|
||||
type BindingContext<'a> = (NodeId, Option<NodeId>, Exceptions);
|
||||
type SpannedName<'a> = (&'a str, TextRange);
|
||||
type BindingContext = (NodeId, Option<NodeId>, Exceptions);
|
||||
|
||||
pub(crate) fn unused_import(checker: &Checker, scope: &Scope, diagnostics: &mut Vec<Diagnostic>) {
|
||||
// Collect all unused imports by statement.
|
||||
|
@ -139,12 +139,12 @@ pub(crate) fn unused_import(checker: &Checker, scope: &Scope, diagnostics: &mut
|
|||
ignored
|
||||
.entry((stmt_id, parent_id, exceptions))
|
||||
.or_default()
|
||||
.push((qualified_name, &binding.range));
|
||||
.push((qualified_name, binding.range));
|
||||
} else {
|
||||
unused
|
||||
.entry((stmt_id, parent_id, exceptions))
|
||||
.or_default()
|
||||
.push((qualified_name, &binding.range));
|
||||
.push((qualified_name, binding.range));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,7 @@ pub(crate) fn unused_import(checker: &Checker, scope: &Scope, diagnostics: &mut
|
|||
},
|
||||
multiple,
|
||||
},
|
||||
*range,
|
||||
range,
|
||||
);
|
||||
if stmt.is_import_from_stmt() {
|
||||
diagnostic.set_parent(stmt.start());
|
||||
|
@ -232,7 +232,7 @@ pub(crate) fn unused_import(checker: &Checker, scope: &Scope, diagnostics: &mut
|
|||
},
|
||||
multiple,
|
||||
},
|
||||
*range,
|
||||
range,
|
||||
);
|
||||
if stmt.is_import_from_stmt() {
|
||||
diagnostic.set_parent(stmt.start());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue