From 10abdb1ffa51013c31db612570bd9f49dbd23018 Mon Sep 17 00:00:00 2001 From: xBLACKICEx Date: Mon, 19 Sep 2022 23:37:12 +0200 Subject: [PATCH] change len == 0 to is_empty() The original code was not compliant with the use of the Rust norm due to avoidance. https://rust-lang.github.io/rust-clippy/master/index.html#len_zero --- src/first-try/hello-world.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/first-try/hello-world.md b/src/first-try/hello-world.md index fa0b3bb1..23006071 100644 --- a/src/first-try/hello-world.md +++ b/src/first-try/hello-world.md @@ -71,7 +71,7 @@ fn main() { let records = penguin_data.lines(); for (i, record) in records.enumerate() { - if i == 0 || record.trim().len() == 0 { + if i == 0 || record.trim().is_empty() { continue; }