History

feat: `TagRefIter::tagger()`. (#389)

Additionally ergonomics have been improved as the iterator is now `Copy`, similarly to the other iterators.

Sebastian Thiel committed 4 years ago

Commit 0d22ab41 parent 6d023e34 files · +23 −9Browse files

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

Unified · Split

git-object/src/commit/ref_iter.rs+0−3
@@ -77,7 +77,6 @@ impl<'a> CommitRefIter<'a> { · 76 unmodified lines
77 }77 }
78 78
79 /// Returns the committer signature if there is no decoding error.79 /// Returns the committer signature if there is no decoding error.
80 /// Errors are coerced into options, hiding whether there was an error or not. The caller knows if there was an error or not.
81 pub fn committer(mut self) -> Result<git_actor::SignatureRef<'a>, crate::decode::Error> {80 pub fn committer(mut self) -> Result<git_actor::SignatureRef<'a>, crate::decode::Error> {
82 self.find_map(|t| match t {81 self.find_map(|t| match t {
83 Ok(Token::Committer { signature }) => Some(Ok(signature)),82 Ok(Token::Committer { signature }) => Some(Ok(signature)),
@@ -90,7 +89,6 @@ impl<'a> CommitRefIter<'a> { · 6 unmodified lines
90 /// Returns the author signature if there is no decoding error.89 /// Returns the author signature if there is no decoding error.
91 ///90 ///
92 /// It may contain white space surrounding it, and is exactly as parsed.91 /// It may contain white space surrounding it, and is exactly as parsed.
93 /// Errors are coerced into options, hiding whether there was an error or not. The caller knows if there was an error or not.
94 pub fn author(mut self) -> Result<git_actor::SignatureRef<'a>, crate::decode::Error> {92 pub fn author(mut self) -> Result<git_actor::SignatureRef<'a>, crate::decode::Error> {
95 self.find_map(|t| match t {93 self.find_map(|t| match t {
96 Ok(Token::Author { signature }) => Some(Ok(signature)),94 Ok(Token::Author { signature }) => Some(Ok(signature)),
@@ -104,7 +102,6 @@ impl<'a> CommitRefIter<'a> { · 7 unmodified lines
104 ///102 ///
105 /// It may contain white space surrounding it, and is exactly as103 /// It may contain white space surrounding it, and is exactly as
106 // parsed.104 // parsed.
107 /// Errors are coerced into options, hiding whether there was an error or not. The caller knows if there was an error or not.
108 pub fn message(mut self) -> Result<&'a BStr, crate::decode::Error> {105 pub fn message(mut self) -> Result<&'a BStr, crate::decode::Error> {
109 self.find_map(|t| match t {106 self.find_map(|t| match t {
110 Ok(Token::Message(msg)) => Some(Ok(msg)),107 Ok(Token::Message(msg)) => Some(Ok(msg)),