From c9eee7f1d0be588df3a6a070f2e7c4f6c1c9c3da Mon Sep 17 00:00:00 2001 From: Joscha Date: Sat, 27 Aug 2022 12:06:32 +0200 Subject: [PATCH] Clean up cursor movement code a bit --- src/ui/chat/tree/cursor.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ui/chat/tree/cursor.rs b/src/ui/chat/tree/cursor.rs index 99e8344..de24c43 100644 --- a/src/ui/chat/tree/cursor.rs +++ b/src/ui/chat/tree/cursor.rs @@ -190,7 +190,7 @@ impl> InnerTreeViewState { self.cursor = Cursor::Msg(id); } } - Cursor::Msg(ref mut msg) => { + Cursor::Msg(msg) => { let path = self.store.path(msg).await; let mut tree = self.store.tree(path.first()).await; Self::find_prev_msg(&self.store, &self.folded, &mut tree, msg).await; @@ -211,7 +211,7 @@ impl> InnerTreeViewState { pub async fn move_cursor_down(&mut self) { match &mut self.cursor { - Cursor::Msg(ref mut msg) => { + Cursor::Msg(msg) => { let path = self.store.path(msg).await; let mut tree = self.store.tree(path.first()).await; if !Self::find_next_msg(&self.store, &self.folded, &mut tree, msg).await { @@ -247,7 +247,7 @@ impl> InnerTreeViewState { self.cursor = Cursor::Msg(last_tree_id); } } - Cursor::Msg(ref mut msg) => { + Cursor::Msg(msg) => { let path = self.store.path(msg).await; let mut tree = self.store.tree(path.first()).await; Self::find_prev_sibling(&self.store, &mut tree, msg).await; @@ -271,7 +271,7 @@ impl> InnerTreeViewState { pub async fn move_cursor_down_sibling(&mut self) { match &mut self.cursor { - Cursor::Msg(ref mut msg) => { + Cursor::Msg(msg) => { let path = self.store.path(msg).await; let mut tree = self.store.tree(path.first()).await; if !Self::find_next_sibling(&self.store, &mut tree, msg).await