Skip to content

Commit 85a55db

Browse files
committed
Fix clippy issues on nightly
This fixes issues found by `clippy 0.1.95 (f134bbc78d 2026-01-24)`.
1 parent 13d75df commit 85a55db

File tree

7 files changed

+7
-9
lines changed

7 files changed

+7
-9
lines changed

asyncgit/src/revlog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub struct AsyncLog {
4949

5050
static LIMIT_COUNT: usize = 3000;
5151
static SLEEP_FOREGROUND: Duration = Duration::from_millis(2);
52-
static SLEEP_BACKGROUND: Duration = Duration::from_millis(1000);
52+
static SLEEP_BACKGROUND: Duration = Duration::from_secs(1);
5353

5454
impl AsyncLog {
5555
///

asyncgit/src/sync/tags.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub fn get_tags_with_metadata(
141141
})
142142
.collect();
143143

144-
tags.sort_unstable_by(|a, b| b.time.cmp(&a.time));
144+
tags.sort_unstable_by_key(|b| std::cmp::Reverse(b.time));
145145

146146
Ok(tags)
147147
}

src/input.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::{
1212
};
1313

1414
static FAST_POLL_DURATION: Duration = Duration::from_millis(100);
15-
static SLOW_POLL_DURATION: Duration = Duration::from_millis(10000);
15+
static SLOW_POLL_DURATION: Duration = Duration::from_secs(10);
1616

1717
///
1818
#[derive(Clone, Copy, Debug)]

src/popups/branchlist.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,7 @@ impl BranchListPopup {
307307
if self.visible {
308308
self.has_remotes =
309309
get_branches_info(&self.repo.borrow(), false)
310-
.map(|branches| !branches.is_empty())
311-
.unwrap_or(false);
310+
.is_ok_and(|branches| !branches.is_empty());
312311
}
313312
}
314313

src/popups/reset.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl ResetPopup {
120120
///
121121
#[allow(clippy::unnecessary_wraps)]
122122
pub fn update(&mut self) -> Result<()> {
123-
self.git_branch_name.lookup().map(Some).unwrap_or(None);
123+
self.git_branch_name.lookup().ok();
124124

125125
Ok(())
126126
}

src/popups/taglist.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,7 @@ impl TagListPopup {
312312

313313
self.has_remotes =
314314
sync::get_branches_info(&self.repo.borrow(), false)
315-
.map(|branches| !branches.is_empty())
316-
.unwrap_or(false);
315+
.is_ok_and(|branches| !branches.is_empty());
317316

318317
let basic_credential = if self.has_remotes {
319318
if need_username_password(&self.repo.borrow())? {

src/tabs/status.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ impl Status {
382382

383383
///
384384
pub fn update(&mut self) -> Result<()> {
385-
self.git_branch_name.lookup().map(Some).unwrap_or(None);
385+
let _ = self.git_branch_name.lookup().ok();
386386

387387
if self.is_visible() {
388388
let config =

0 commit comments

Comments
 (0)