From 64e6e44f051c83618c95b7f8f61ae3f17df61756 Mon Sep 17 00:00:00 2001 From: Jonathan Plasse <13716151+JonathanPlasse@users.noreply.github.com> Date: Sat, 19 Nov 2022 06:29:12 +0100 Subject: [PATCH] Clean up print_call --- src/flake8_print/checks.rs | 3 +-- src/flake8_print/plugins/print_call.rs | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/flake8_print/checks.rs b/src/flake8_print/checks.rs index 1fd6b98b1af785..00f371d95ec99a 100644 --- a/src/flake8_print/checks.rs +++ b/src/flake8_print/checks.rs @@ -5,7 +5,6 @@ use crate::checks::{Check, CheckKind}; /// Check whether a function call is a `print` or `pprint` invocation pub fn print_call( - expr: &Expr, func: &Expr, check_print: bool, check_pprint: bool, @@ -13,7 +12,7 @@ pub fn print_call( ) -> Option { if let ExprKind::Name { id, .. } = &func.node { if check_print && id == "print" { - return Some(Check::new(CheckKind::PrintFound, Range::from_located(expr))); + return Some(Check::new(CheckKind::PrintFound, location)); } else if check_pprint && id == "pprint" { return Some(Check::new(CheckKind::PPrintFound, location)); } diff --git a/src/flake8_print/plugins/print_call.rs b/src/flake8_print/plugins/print_call.rs index 36f794eca4d17b..e9f9cbda39584c 100644 --- a/src/flake8_print/plugins/print_call.rs +++ b/src/flake8_print/plugins/print_call.rs @@ -10,7 +10,6 @@ use crate::flake8_print::checks; /// T201, T203 pub fn print_call(checker: &mut Checker, expr: &Expr, func: &Expr) { if let Some(mut check) = checks::print_call( - expr, func, checker.settings.enabled.contains(&CheckCode::T201), checker.settings.enabled.contains(&CheckCode::T203),