summaryrefslogtreecommitdiffstats
path: root/examples/lazy
diff options
context:
space:
mode:
authorLibravatar Nick Senger <dev@nsenger.com>2023-01-10 22:00:42 -0800
committerLibravatar Nick Senger <dev@nsenger.com>2023-01-10 22:00:42 -0800
commitc7c5611087c37ab7bffcfcd91e19dbf71ccc8e11 (patch)
tree1dbf59aab15130724cd6453da6cd87afe948db49 /examples/lazy
parent45dda41c4cad6a2008fe4a51ecb68e9103cd075c (diff)
downloadiced-c7c5611087c37ab7bffcfcd91e19dbf71ccc8e11.tar.gz
iced-c7c5611087c37ab7bffcfcd91e19dbf71ccc8e11.tar.bz2
iced-c7c5611087c37ab7bffcfcd91e19dbf71ccc8e11.zip
clippy
Diffstat (limited to 'examples/lazy')
-rw-r--r--examples/lazy/src/main.rs12
1 files changed, 9 insertions, 3 deletions
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<Color> 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())
}
});