From 9c8c802b207224ec3644042eb5139bd96f62a603 Mon Sep 17 00:00:00 2001 From: extrawurst Date: Sun, 24 Mar 2024 12:50:56 -0700 Subject: [PATCH] fix nightly clippy --- src/components/changes.rs | 3 --- src/components/diff.rs | 1 - src/components/revision_files.rs | 5 ----- src/popups/revision_files.rs | 7 +------ src/queue.rs | 2 -- 5 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/components/changes.rs b/src/components/changes.rs index 9a8d5859..3ac42b74 100644 --- a/src/components/changes.rs +++ b/src/components/changes.rs @@ -148,12 +148,9 @@ impl ChangesComponent { fn dispatch_reset_workdir(&mut self) -> bool { if let Some(tree_item) = self.selection() { - let is_folder = - matches!(tree_item.kind, FileTreeItemKind::Path(_)); self.queue.push(InternalEvent::ConfirmAction( Action::Reset(ResetItem { path: tree_item.info.full_path, - is_folder, }), )); diff --git a/src/components/diff.rs b/src/components/diff.rs index a6ce3ee3..b7df165d 100644 --- a/src/components/diff.rs +++ b/src/components/diff.rs @@ -617,7 +617,6 @@ impl DiffComponent { self.queue.push(InternalEvent::ConfirmAction(Action::Reset( ResetItem { path: self.current.path.clone(), - is_folder: false, }, ))); } diff --git a/src/components/revision_files.rs b/src/components/revision_files.rs index fdd71866..d2f5bb8f 100644 --- a/src/components/revision_files.rs +++ b/src/components/revision_files.rs @@ -100,11 +100,6 @@ impl RevisionFilesComponent { self.revision.as_ref() } - /// - pub const fn selection(&self) -> Option { - self.tree.selection() - } - /// pub fn update(&mut self, ev: AsyncNotification) -> Result<()> { self.current_file.update(ev); diff --git a/src/popups/revision_files.rs b/src/popups/revision_files.rs index 92560ccf..9fbe9e25 100644 --- a/src/popups/revision_files.rs +++ b/src/popups/revision_files.rs @@ -18,15 +18,11 @@ use std::path::Path; #[derive(Clone, Debug)] pub struct FileTreeOpen { pub commit_id: CommitId, - pub selection: Option, } impl FileTreeOpen { pub const fn new(commit_id: CommitId) -> Self { - Self { - commit_id, - selection: None, - } + Self { commit_id } } } @@ -81,7 +77,6 @@ impl RevisionFilesPopup { self.queue.push(InternalEvent::PopupStackPush( StackablePopupOpen::FileTree(FileTreeOpen { commit_id: revision.id, - selection: self.files.selection(), }), )); } diff --git a/src/queue.rs b/src/queue.rs index d4f9da8e..9ee7830b 100644 --- a/src/queue.rs +++ b/src/queue.rs @@ -35,8 +35,6 @@ bitflags! { pub struct ResetItem { /// path to the item (folder/file) pub path: String, - /// are talking about a folder here? otherwise it's a single file - pub is_folder: bool, } ///