diff --git a/crates/ruff/src/rules/pyflakes/rules/unused_import.rs b/crates/ruff/src/rules/pyflakes/rules/unused_import.rs index be08c5a1c4..a8f25b8809 100644 --- a/crates/ruff/src/rules/pyflakes/rules/unused_import.rs +++ b/crates/ruff/src/rules/pyflakes/rules/unused_import.rs @@ -100,8 +100,8 @@ impl Violation for UnusedImport { } } -type SpannedName<'a> = (&'a str, &'a TextRange); -type BindingContext<'a> = (NodeId, Option, Exceptions); +type SpannedName<'a> = (&'a str, TextRange); +type BindingContext = (NodeId, Option, Exceptions); pub(crate) fn unused_import(checker: &Checker, scope: &Scope, diagnostics: &mut Vec) { // 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());