From d3f5f190c327d0d5e77b70c5d4cf5ec00959fc00 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Sat, 23 Dec 2023 21:01:52 -0500 Subject: [PATCH] clippy::len_zero warning: length comparison to zero --> src/cmd/sqlp.rs:505:25 | 505 | .filter(|s| s.trim().len() > 0) | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!s.trim().is_empty()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero = note: `#[warn(clippy::len_zero)]` on by default --- src/cmd/sqlp.rs | 2 +- src/main.rs | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/cmd/sqlp.rs b/src/cmd/sqlp.rs index a0446aa2d..e2da084ea 100644 --- a/src/cmd/sqlp.rs +++ b/src/cmd/sqlp.rs @@ -502,7 +502,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> { sql_script .split(';') .map(std::string::ToString::to_string) - .filter(|s| s.trim().len() > 0) + .filter(|s| !s.trim().is_empty()) .collect() } else { // its not a sql script, just a single query diff --git a/src/main.rs b/src/main.rs index ae291d59d..213419e0b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,8 +25,6 @@ clippy::unnecessary_wraps, // false positive clippy::needless_doctest_main, - // performance - clippy::len_zero, // noisy clippy::missing_errors_doc, clippy::must_use_candidate,