From 084586221b6d5c9b11f3a033af066b6c36214d15 Mon Sep 17 00:00:00 2001 From: expectocode Date: Wed, 25 Mar 2020 17:29:21 +0000 Subject: [PATCH] Apply clippy fixes --- src/lib/mod.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/mod.rs b/src/lib/mod.rs index b83a860..c05cea3 100644 --- a/src/lib/mod.rs +++ b/src/lib/mod.rs @@ -22,16 +22,16 @@ pub struct HacksawResult { impl HacksawResult { pub fn x(&self) -> i16 { - return self.rect.x(); + self.rect.x() } pub fn y(&self) -> i16 { - return self.rect.y(); + self.rect.y() } pub fn width(&self) -> u16 { - return self.rect.width(); + self.rect.width() } pub fn height(&self) -> u16 { - return self.rect.height(); + self.rect.height() } pub fn relative_to(&self, parent: HacksawResult) -> HacksawResult { @@ -54,9 +54,9 @@ impl HacksawResult { && point.y() - self.y() <= self.height() as i16 } - pub fn fill_format_string(&self, format: &Vec) -> String { + pub fn fill_format_string(&self, format: &[FormatToken]) -> String { format - .into_iter() + .iter() .map(|token| match token { FormatToken::WindowId => self.window.to_string(), FormatToken::Geometry => format!( @@ -223,7 +223,7 @@ pub fn get_window_at_point( }) .collect::>(); - if children.len() == 0 { + if children.is_empty() { return None; }