Skip to content

Commit cc90799

Browse files
authored
fix latest clippy (#2597)
1 parent 7f75307 commit cc90799

File tree

21 files changed

+44
-24
lines changed

21 files changed

+44
-24
lines changed

asyncgit/src/sync/branch/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ pub fn config_is_pull_rebase(repo_path: &RepoPath) -> Result<bool> {
271271
let value =
272272
rebase.value().map(String::from).unwrap_or_default();
273273
return Ok(value == "true");
274-
};
274+
}
275275

276276
Ok(false)
277277
}

asyncgit/src/sync/commit.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ pub fn amend(
5555
/// Wrap `Repository::signature` to allow unknown user.name.
5656
///
5757
/// See <https://github.com/gitui-org/gitui/issues/79>.
58-
#[allow(clippy::redundant_pub_crate)]
5958
pub(crate) fn signature_allow_undefined_name(
6059
repo: &Repository,
6160
) -> std::result::Result<Signature<'_>, git2::Error> {

asyncgit/src/sync/remotes/push.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use crate::{
1717
use crossbeam_channel::Sender;
1818
use git2::{PackBuilderStage, PushOptions};
1919
use scopetime::scope_time;
20+
use std::fmt::Write as _;
2021

2122
///
2223
pub trait AsyncProgress: Clone + Send + Sync {
@@ -182,7 +183,7 @@ pub fn push_raw(
182183
if let Ok(Some(branch_upstream_merge)) =
183184
get_branch_upstream_merge(repo_path, branch)
184185
{
185-
push_ref.push_str(&format!(":{branch_upstream_merge}"));
186+
let _ = write!(push_ref, ":{branch_upstream_merge}");
186187
}
187188
}
188189

filetreelist/src/item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl TreeItemInfo {
5555
Path::new(
5656
self.full_path
5757
.components()
58-
.last()
58+
.next_back()
5959
.and_then(|c| c.as_os_str().to_str())
6060
.unwrap_or_default(),
6161
)

filetreelist/src/treeitems_iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl<'a> Iterator for TreeItemsIterator<'a> {
3535
*i += 1;
3636
} else {
3737
self.increments = Some(0);
38-
};
38+
}
3939

4040
loop {
4141
if !init {

src/app.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ impl App {
275275
3 => self.stashing_tab.draw(f, chunks_main[1])?,
276276
4 => self.stashlist_tab.draw(f, chunks_main[1])?,
277277
_ => bail!("unknown tab"),
278-
};
278+
}
279279
}
280280

281281
self.draw_popups(f)?;
@@ -905,7 +905,7 @@ impl App {
905905
InternalEvent::CommitSearch(options) => {
906906
self.revlog.search(options);
907907
}
908-
};
908+
}
909909

910910
Ok(flags)
911911
}
@@ -997,7 +997,7 @@ impl App {
997997
undo_last_commit(&self.repo.borrow())
998998
);
999999
}
1000-
};
1000+
}
10011001

10021002
flags.insert(NeedsUpdate::ALL);
10031003

@@ -1019,7 +1019,7 @@ impl App {
10191019
));
10201020

10211021
self.tags_popup.update_tags()?;
1022-
};
1022+
}
10231023
Ok(())
10241024
}
10251025

src/components/changes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl ChangesComponent {
9292
&self.repo.borrow(),
9393
path,
9494
)?,
95-
};
95+
}
9696
} else {
9797
let config =
9898
self.options.borrow().status_show_untracked();

src/components/commitlist.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ impl CommitList {
115115
}
116116

117117
///
118+
#[expect(
119+
clippy::missing_const_for_fn,
120+
reason = "as of 1.86.0 clippy wants this to be const even though that breaks"
121+
)]
118122
pub fn marked(&self) -> &[(usize, CommitId)] {
119123
&self.marked
120124
}

src/components/textinput.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ impl TextInputComponent {
176176
)
177177
.title(self.title.clone()),
178178
);
179-
};
179+
}
180180
text_area
181181
});
182182
}

src/components/utils/filetree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl FileTreeItem {
9090

9191
match path
9292
.components()
93-
.last()
93+
.next_back()
9494
.map(std::path::Component::as_os_str)
9595
.map(OsStr::to_string_lossy)
9696
.map(String::from)

0 commit comments

Comments
 (0)