From 79ae1840af51784f8d2c8831bb5ed55ccd7c8f0b Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 5 Jun 2023 15:09:27 -0400 Subject: [PATCH] Remove unused lifetime from UnusedImport type alias (#4874) --- .../ruff/src/rules/pyflakes/rules/unused_import.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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());