History

refactor

Sebastian Thiel committed 5 years ago

Commit 082f8d01 parent bd4d21e1 file · +13 −9Browse files

Showing the changes to git-diff/src (1 of 1 file). Show all

Unified · Split

git-diff/src/tree/changes.rs+13−9
@@ -12,7 +12,7 @@ quick_error! { · 11 unmodified lines
1212 #[derive(Debug)]
1313 #[allow(missing_docs)]
1414 pub enum Error {
15− NotFound(oid: ObjectId) {
15+ NotFound { oid: ObjectId } {
1616 display("The object {} referenced by the tree was not found in the database", oid)
1717 }
1818 Cancelled {
@@ -77,20 +77,24 @@ impl<'a> tree::Changes<'a> { · 58 unmodified lines
7777 match state.trees.pop_front() {
7878 Some((None, Some(rhs))) => {
7979 delegate.set_current_path(rhs.parent_path_id.clone());
80− rhs_entries =
81− peekable(locate(&rhs.tree_id, &mut state.buf2).ok_or(Error::NotFound(rhs.tree_id))?);
80+ rhs_entries = peekable(
81+ locate(&rhs.tree_id, &mut state.buf2).ok_or(Error::NotFound { oid: rhs.tree_id })?,
82+ );
8283 }
8384 Some((Some(lhs), Some(rhs))) => {
8485 delegate.set_current_path(lhs.parent_path_id.clone());
85− lhs_entries =
86− peekable(locate(&lhs.tree_id, &mut state.buf1).ok_or(Error::NotFound(lhs.tree_id))?);
87− rhs_entries =
88− peekable(locate(&rhs.tree_id, &mut state.buf2).ok_or(Error::NotFound(rhs.tree_id))?);
86+ lhs_entries = peekable(
87+ locate(&lhs.tree_id, &mut state.buf1).ok_or(Error::NotFound { oid: lhs.tree_id })?,
88+ );
89+ rhs_entries = peekable(
90+ locate(&rhs.tree_id, &mut state.buf2).ok_or(Error::NotFound { oid: rhs.tree_id })?,
91+ );
8992 }
9093 Some((Some(lhs), None)) => {
9194 delegate.set_current_path(lhs.parent_path_id.clone());
92− lhs_entries =
93− peekable(locate(&lhs.tree_id, &mut state.buf1).ok_or(Error::NotFound(lhs.tree_id))?);
95+ lhs_entries = peekable(
96+ locate(&lhs.tree_id, &mut state.buf1).ok_or(Error::NotFound { oid: lhs.tree_id })?,
97+ );
9498 }
9599 Some((None, None)) => unreachable!("BUG: it makes no sense to fill the stack with empties"),
96100 None => return Ok(()),

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t