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
49 /// call the method as intended. Such a squelched error cannot be recovered unless the objects data is retrieved and parsed again.49 /// call the method as intended. Such a squelched error cannot be recovered unless the objects data is retrieved and parsed again.
50 /// `next()`.50 /// `next()`.
51 pub fn tree_id(&mut self) -> Option<ObjectId> {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 /// Returns all signatures, first the author, then the committer, if there is no decoding error.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 /// Return the owned object id of this token if its a [tree][Token::Tree] or a [parent commit][Token::Parent].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 match self {223 match self {
224 Token::Tree { id } | Token::Parent { id } => Some(id),224 Token::Tree { id } | Token::Parent { id } => Some(id),
225 _ => None,225 _ => None,