Satisfy clippy
This commit is contained in:
parent
5acf49d018
commit
20186bda5c
2 changed files with 6 additions and 4 deletions
|
|
@ -388,6 +388,7 @@ impl<M: Msg + ChatMsg, S: MsgStore<M>> InnerTreeViewState<M, S> {
|
|||
// 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<M: Msg + ChatMsg, S: MsgStore<M>> InnerTreeViewState<M, S> {
|
|||
// 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);
|
||||
|
|
|
|||
|
|
@ -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(")"),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue