From 20186bda5ce9e7c0abf6b87c2f3448f99f200594 Mon Sep 17 00:00:00 2001 From: Joscha Date: Thu, 5 Jan 2023 14:21:50 +0100 Subject: [PATCH] Satisfy clippy --- src/ui/chat/tree/layout.rs | 2 ++ src/ui/rooms.rs | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ui/chat/tree/layout.rs b/src/ui/chat/tree/layout.rs index 3a22bc0..bc6f4de 100644 --- a/src/ui/chat/tree/layout.rs +++ b/src/ui/chat/tree/layout.rs @@ -388,6 +388,7 @@ impl> InnerTreeViewState { // message should always be visible. I'm not using top_line.clamp(...) // because the order of the min and max matters. let top_line = block.top_line; + #[allow(clippy::manual_clamp)] let new_top_line = top_line.min(max_line).max(min_line); if new_top_line != top_line { blocks.blocks_mut().offset(new_top_line - top_line); @@ -415,6 +416,7 @@ impl> InnerTreeViewState { // because the order of the min and max matters. let top_line = block.top_line; let new_top_line = (height - block.height) / 2; + #[allow(clippy::manual_clamp)] let new_top_line = new_top_line.min(max_line).max(min_line); if new_top_line != top_line { blocks.blocks_mut().offset(new_top_line - top_line); diff --git a/src/ui/rooms.rs b/src/ui/rooms.rs index 3e4d9d0..f79cb1e 100644 --- a/src/ui/rooms.rs +++ b/src/ui/rooms.rs @@ -265,13 +265,13 @@ impl Rooms { match (status, unseen) { (None, None) => Styled::default(), (None, Some(u)) => Styled::new_plain(" (") - .then(&u, unseen_style) + .then(u, unseen_style) .then_plain(")"), - (Some(s), None) => Styled::new_plain(" (").then_plain(&s).then_plain(")"), + (Some(s), None) => Styled::new_plain(" (").then_plain(s).then_plain(")"), (Some(s), Some(u)) => Styled::new_plain(" (") - .then_plain(&s) + .then_plain(s) .then_plain(", ") - .then(&u, unseen_style) + .then(u, unseen_style) .then_plain(")"), } }