From c997aad85d7ee6e77085e50e5e599002549d228f Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Tue, 19 Sep 2023 01:46:46 -0400 Subject: Chore: Apply clippy map transformations Convert `.map().unwrap_or()` to `.map_or()` and similar transformations. --- core/src/mouse/click.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'core/src/mouse') diff --git a/core/src/mouse/click.rs b/core/src/mouse/click.rs index 4a7d796c..240e5c64 100644 --- a/core/src/mouse/click.rs +++ b/core/src/mouse/click.rs @@ -69,8 +69,6 @@ impl Click { }; self.position == new_position - && duration - .map(|duration| duration.as_millis() <= 300) - .unwrap_or(false) + && duration.is_some_and(|duration| duration.as_millis() <= 300) } } -- cgit From 6c386e90a12fd26da12541da3f086dddb7211c0c Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 20 Sep 2023 04:33:48 +0200 Subject: Fix `clippy::trivially-copy-pass-by-ref` --- core/src/mouse/click.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/src/mouse') diff --git a/core/src/mouse/click.rs b/core/src/mouse/click.rs index 240e5c64..53354098 100644 --- a/core/src/mouse/click.rs +++ b/core/src/mouse/click.rs @@ -24,7 +24,7 @@ pub enum Kind { } impl Kind { - fn next(&self) -> Kind { + fn next(self) -> Kind { match self { Kind::Single => Kind::Double, Kind::Double => Kind::Triple, -- cgit From b27762554627b8e89f2b840b1a8a512e22d4cd87 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 20 Sep 2023 16:26:43 +0200 Subject: Revert "Chore: Apply clippy map transformations" This reverts commit c997aad85d7ee6e77085e50e5e599002549d228f. --- core/src/mouse/click.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core/src/mouse') diff --git a/core/src/mouse/click.rs b/core/src/mouse/click.rs index 53354098..9cc44a71 100644 --- a/core/src/mouse/click.rs +++ b/core/src/mouse/click.rs @@ -69,6 +69,8 @@ impl Click { }; self.position == new_position - && duration.is_some_and(|duration| duration.as_millis() <= 300) + && duration + .map(|duration| duration.as_millis() <= 300) + .unwrap_or(false) } } -- cgit