Skip to content

Commit 5445594

Browse files
author
Stephan Dilly
committed
fix amend due to blind clippy warning refactoring (closes #250)
1 parent 726928b commit 5445594

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/components/commit.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,10 @@ impl CommitComponent {
208208
return Ok(());
209209
}
210210

211-
let res =
212-
self.amend.map_or(sync::commit(CWD, &msg), |amend| {
213-
sync::amend(CWD, amend, &msg)
214-
});
211+
let res = self.amend.map_or_else(
212+
|| sync::commit(CWD, &msg),
213+
|amend| sync::amend(CWD, amend, &msg),
214+
);
215215
if let Err(e) = res {
216216
log::error!("commit error: {}", &e);
217217
self.queue.borrow_mut().push_back(

src/components/utils/statustree.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ impl StatusTree {
4444
let last_selection_index = self.selection.unwrap_or(0);
4545

4646
self.tree = FileTreeItems::new(list, &last_collapsed)?;
47-
self.selection = last_selection.as_ref().map_or(
48-
self.tree.items().first().map(|_| 0),
47+
self.selection = last_selection.as_ref().map_or_else(
48+
|| self.tree.items().first().map(|_| 0),
4949
|last_selection| {
5050
self.find_last_selection(
5151
last_selection,

0 commit comments

Comments
 (0)