Showing the changes to git-diff/src (1 of 1 file). Show all
Unified · Split
| @@ -12,7 +12,7 @@ quick_error! { · 11 unmodified lines | ||
| 12 | 12 | #[derive(Debug)] |
| 13 | 13 | #[allow(missing_docs)] |
| 14 | 14 | pub enum Error { |
| 15 | − NotFound(oid: ObjectId) { | |
| 15 | + NotFound { oid: ObjectId } { | |
| 16 | 16 | display("The object {} referenced by the tree was not found in the database", oid) |
| 17 | 17 | } |
| 18 | 18 | Cancelled { |
| @@ -77,20 +77,24 @@ impl<'a> tree::Changes<'a> { · 58 unmodified lines | ||
| 77 | 77 | match state.trees.pop_front() { |
| 78 | 78 | Some((None, Some(rhs))) => { |
| 79 | 79 | 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 | + ); | |
| 82 | 83 | } |
| 83 | 84 | Some((Some(lhs), Some(rhs))) => { |
| 84 | 85 | 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 | + ); | |
| 89 | 92 | } |
| 90 | 93 | Some((Some(lhs), None)) => { |
| 91 | 94 | 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 | + ); | |
| 94 | 98 | } |
| 95 | 99 | Some((None, None)) => unreachable!("BUG: it makes no sense to fill the stack with empties"), |
| 96 | 100 | None => return Ok(()), |