From 8d2de65868a4a4ea4b46af2dcd89dab43ce70b61 Mon Sep 17 00:00:00 2001 From: extrawurst Date: Wed, 23 Nov 2022 15:14:12 +0100 Subject: [PATCH] fix clippy nightly --- asyncgit/src/sync/diff.rs | 4 ++-- src/app.rs | 2 +- src/main.rs | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/asyncgit/src/sync/diff.rs b/asyncgit/src/sync/diff.rs index c5bc17ca..64a0aee4 100644 --- a/asyncgit/src/sync/diff.rs +++ b/asyncgit/src/sync/diff.rs @@ -253,8 +253,8 @@ pub fn get_diff_commits( /// //TODO: refactor into helper type with the inline closures as dedicated functions #[allow(clippy::too_many_lines)] -fn raw_diff_to_file_diff<'a>( - diff: &'a Diff, +fn raw_diff_to_file_diff( + diff: &Diff, work_dir: &Path, ) -> Result { let res = Rc::new(RefCell::new(FileDiff::default())); diff --git a/src/app.rs b/src/app.rs index ec1294be..8fc8a432 100644 --- a/src/app.rs +++ b/src/app.rs @@ -445,7 +445,7 @@ impl App { self.process_queue(flags)?; } else if let InputEvent::State(polling_state) = ev { self.external_editor_popup.hide(); - if let InputState::Paused = polling_state { + if matches!(polling_state, InputState::Paused) { let result = match self.file_to_open.take() { Some(path) => { ExternalEditorComponent::open_file_in_editor( diff --git a/src/main.rs b/src/main.rs index 6a45b857..8a8d79e1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -214,7 +214,7 @@ fn run_app( }; { - if let QueueEvent::SpinnerUpdate = event { + if matches!(event, QueueEvent::SpinnerUpdate) { spinner.update(); spinner.draw(terminal)?; continue; @@ -224,8 +224,10 @@ fn run_app( match event { QueueEvent::InputEvent(ev) => { - if let InputEvent::State(InputState::Polling) = ev - { + if matches!( + ev, + InputEvent::State(InputState::Polling) + ) { //Note: external ed closed, we need to re-hide cursor terminal.hide_cursor()?; }