From fc38ebce66271b6fc627031c784cfe5c8ff515bc Mon Sep 17 00:00:00 2001 From: Erik Kundt Date: Sat, 13 Dec 2025 01:03:32 +0100 Subject: [PATCH] chore: Update to Rust 1.92 --- bin/commands/patch/review.rs | 3 ++- bin/git.rs | 2 +- bin/ui/items.rs | 6 +++--- bin/ui/items/notification.rs | 2 +- examples/selection.rs | 2 +- rust-toolchain.toml | 2 +- src/terminal.rs | 2 +- src/ui.rs | 2 +- 8 files changed, 11 insertions(+), 10 deletions(-) diff --git a/bin/commands/patch/review.rs b/bin/commands/patch/review.rs index 48ca49c8..2ea8e4de 100644 --- a/bin/commands/patch/review.rs +++ b/bin/commands/patch/review.rs @@ -44,6 +44,7 @@ pub enum ReviewAction { Comment, } +#[allow(dead_code)] #[derive(Clone, Debug, Eq, PartialEq)] pub struct Args(String); @@ -704,7 +705,7 @@ mod test { use crate::test; impl App<'_> { - pub fn hunks(&self) -> Vec { + pub fn hunks(&self) -> Vec> { self.hunks.lock().unwrap().clone() } } diff --git a/bin/git.rs b/bin/git.rs index 74bfcbc1..9c816467 100644 --- a/bin/git.rs +++ b/bin/git.rs @@ -295,7 +295,7 @@ impl HunkDiff { } } - pub fn paths(&self) -> FilePaths { + pub fn paths(&self) -> FilePaths<'_> { match self { Self::Added { path, new, .. } => (None, Some((path, new.oid))), Self::Deleted { path, old, .. } => (Some((path, old.oid)), None), diff --git a/bin/ui/items.rs b/bin/ui/items.rs index 72b2c7a5..22aff2f3 100644 --- a/bin/ui/items.rs +++ b/bin/ui/items.rs @@ -231,7 +231,7 @@ impl IssueItem { } impl ToRow<8> for IssueItem { - fn to_row(&self) -> [Cell; 8] { + fn to_row(&self) -> [Cell<'_>; 8] { let (state, state_color) = format::issue_state(&self.state); let state = span::default(&state).style(Style::default().fg(state_color)); @@ -489,7 +489,7 @@ impl PatchItem { } impl ToRow<9> for PatchItem { - fn to_row(&self) -> [Cell; 9] { + fn to_row(&self) -> [Cell<'_>; 9] { let (state, color) = format::patch_state(&self.state); let state = span::default(&state).style(Style::default().fg(color)); @@ -1024,7 +1024,7 @@ impl From<(&Repository, &Review, &HunkDiff)> for HunkItem<'_> { } impl ToRow<3> for StatefulHunkItem<'_> { - fn to_row(&self) -> [Cell; 3] { + fn to_row(&self) -> [Cell<'_>; 3] { let build_stats_spans = |stats: &DiffStats| -> Vec> { let mut cell = vec![]; let comments = &self.inner().comments; diff --git a/bin/ui/items/notification.rs b/bin/ui/items/notification.rs index 737ca5d4..be5e4806 100644 --- a/bin/ui/items/notification.rs +++ b/bin/ui/items/notification.rs @@ -254,7 +254,7 @@ impl Notification { } impl ToRow<9> for Notification { - fn to_row(&self) -> [Cell; 9] { + fn to_row(&self) -> [Cell<'_>; 9] { let (type_name, summary, status, kind_id) = match &self.kind { NotificationKind::Branch { name, diff --git a/examples/selection.rs b/examples/selection.rs index 65dd6da5..449b2358 100644 --- a/examples/selection.rs +++ b/examples/selection.rs @@ -31,7 +31,7 @@ struct Item { } impl ToRow<3> for Item { - fn to_row(&self) -> [Cell; 3] { + fn to_row(&self) -> [Cell<'_>; 3] { [ Span::raw(self.id.to_string()).magenta().dim().into(), Span::raw(self.title.clone()).into(), diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 7f2259cb..54cf538a 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.88" +channel = "1.92" profile = "default" components = [ "rust-src" ] diff --git a/src/terminal.rs b/src/terminal.rs index 845120e4..c7f24c07 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -53,7 +53,7 @@ impl Terminal { Ok(()) } - pub fn draw(&mut self, f: F) -> io::Result + pub fn draw(&mut self, f: F) -> io::Result> where F: FnOnce(&mut Frame), { diff --git a/src/ui.rs b/src/ui.rs index b7e9a9f1..686b59ea 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -112,7 +112,7 @@ impl From for u16 { /// Needs to be implemented for items that are supposed to be rendered in tables. pub trait ToRow { - fn to_row(&self) -> [Cell; W]; + fn to_row(&self) -> [Cell<'_>; W]; } /// Needs to be implemented for items that are supposed to be rendered in trees.