This makes the method more consistent.
Showing the changes to git-object/src/commit (1 of 1 file). Show all
Unified · Split
| @@ -49,7 +49,7 @@ impl<'a> CommitRefIter<'a> { · 48 unmodified lines | ||
| 49 | 49 | /// call the method as intended. Such a squelched error cannot be recovered unless the objects data is retrieved and parsed again. |
| 50 | 50 | /// `next()`. |
| 51 | 51 | pub fn tree_id(&mut self) -> Option<ObjectId> { |
| 52 | − self.next().and_then(Result::ok).and_then(Token::into_id) | |
| 52 | + self.next().and_then(Result::ok).and_then(Token::try_into_id) | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /// Returns all signatures, first the author, then the committer, if there is no decoding error. |
| @@ -219,7 +219,7 @@ impl<'a> Token<'a> { · 163 unmodified lines | ||
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | /// Return the owned object id of this token if its a [tree][Token::Tree] or a [parent commit][Token::Parent]. |
| 222 | − pub fn into_id(self) -> Option<ObjectId> { | |
| 222 | + pub fn try_into_id(self) -> Option<ObjectId> { | |
| 223 | 223 | match self { |
| 224 | 224 | Token::Tree { id } | Token::Parent { id } => Some(id), |
| 225 | 225 | _ => None, |