fix amend due to blind clippy warning refactoring (closes #250)

This commit is contained in:
Stephan Dilly 2020-08-28 23:56:39 +02:00
parent 726928b7ba
commit 5445594018
2 changed files with 6 additions and 6 deletions

View File

@ -208,10 +208,10 @@ impl CommitComponent {
return Ok(());
}
let res =
self.amend.map_or(sync::commit(CWD, &msg), |amend| {
sync::amend(CWD, amend, &msg)
});
let res = self.amend.map_or_else(
|| sync::commit(CWD, &msg),
|amend| sync::amend(CWD, amend, &msg),
);
if let Err(e) = res {
log::error!("commit error: {}", &e);
self.queue.borrow_mut().push_back(

View File

@ -44,8 +44,8 @@ impl StatusTree {
let last_selection_index = self.selection.unwrap_or(0);
self.tree = FileTreeItems::new(list, &last_collapsed)?;
self.selection = last_selection.as_ref().map_or(
self.tree.items().first().map(|_| 0),
self.selection = last_selection.as_ref().map_or_else(
|| self.tree.items().first().map(|_| 0),
|last_selection| {
self.find_last_selection(
last_selection,