History

change!: rename `commit::ref_iter::Token::into_id()` to `*::try_into_id()`

This makes the method more consistent.

Sebastian Thiel committed 4 years ago

Commit fda2a8d1 parent 6d3f52d1 file · +2 −2Browse files

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

Unified · Split

git-object/src/commit/ref_iter.rs+2−2
@@ -49,7 +49,7 @@ impl<'a> CommitRefIter<'a> { · 48 unmodified lines
4949 /// call the method as intended. Such a squelched error cannot be recovered unless the objects data is retrieved and parsed again.
5050 /// `next()`.
5151 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)
5353 }
5454
5555 /// 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
219219 }
220220
221221 /// 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> {
223223 match self {
224224 Token::Tree { id } | Token::Parent { id } => Some(id),
225225 _ => None,