From d64291245e48b10a88ee6d6a7a4d2ce6c338a7a7 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 22 Jul 2021 14:44:54 +0200 Subject: [PATCH] Janitor: Fix clippy::len_zero --- sixtyfps_compiler/passes/resolving.rs | 2 +- sixtyfps_runtime/corelib/items/text.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sixtyfps_compiler/passes/resolving.rs b/sixtyfps_compiler/passes/resolving.rs index 57310c2d0..3f269d9d0 100644 --- a/sixtyfps_compiler/passes/resolving.rs +++ b/sixtyfps_compiler/passes/resolving.rs @@ -392,7 +392,7 @@ impl Expression { Stop::Finished => {} Stop::Color(col) => stops.push(( col, - if stops.len() == 0 { + if stops.is_empty() { Expression::NumberLiteral(0., Unit::None) } else { Expression::Invalid diff --git a/sixtyfps_runtime/corelib/items/text.rs b/sixtyfps_runtime/corelib/items/text.rs index f22e40b51..4782c10dc 100644 --- a/sixtyfps_runtime/corelib/items/text.rs +++ b/sixtyfps_runtime/corelib/items/text.rs @@ -545,7 +545,7 @@ impl TextInput { fn delete_selection(self: Pin<&Self>) { let text: String = self.text().into(); - if text.len() == 0 { + if text.is_empty() { return; }