From c7c5611087c37ab7bffcfcd91e19dbf71ccc8e11 Mon Sep 17 00:00:00 2001 From: Nick Senger Date: Tue, 10 Jan 2023 22:00:42 -0800 Subject: clippy --- examples/lazy/src/main.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'examples/lazy/src') diff --git a/examples/lazy/src/main.rs b/examples/lazy/src/main.rs index 63c282d3..818c91bc 100644 --- a/examples/lazy/src/main.rs +++ b/examples/lazy/src/main.rs @@ -86,7 +86,7 @@ impl From for iced::Color { } } -#[derive(Clone, Debug, PartialEq, Eq)] +#[derive(Clone, Debug, Eq)] struct Item { name: String, color: Color, @@ -98,6 +98,12 @@ impl Hash for Item { } } +impl PartialEq for Item { + fn eq(&self, other: &Self) -> bool { + self.name.eq(&other.name) + } +} + impl From<&str> for Item { fn from(s: &str) -> Self { Self { @@ -166,10 +172,10 @@ impl Sandbox for App { items.sort_by(|a, b| match self.order { Order::Ascending => { - (&a.name).to_lowercase().cmp(&(&b.name).to_lowercase()) + a.name.to_lowercase().cmp(&b.name.to_lowercase()) } Order::Descending => { - (&b.name).to_lowercase().cmp(&(&a.name).to_lowercase()) + b.name.to_lowercase().cmp(&a.name.to_lowercase()) } }); -- cgit