Showing the changes to git-object/src/commit (1 of 12 files). Show all
Unified · Split
| @@ -58,12 +58,10 @@ impl<'a> CommitRefIter<'a> { · 57 unmodified lines | ||
| 58 | 58 | /// if not exactly two signatures were iterable. |
| 59 | 59 | /// Errors are not the common case - if an error needs to be detectable, use this instance as iterator. |
| 60 | 60 | pub fn signatures(&'a mut self) -> impl Iterator<Item = git_actor::SignatureRef<'_>> + 'a { |
| 61 | − self.filter_map(Result::ok) | |
| 62 | − .skip_while(|t| !matches!(t, Token::Author { .. } | Token::Committer { .. })) | |
| 63 | − .filter_map(|t| match t { | |
| 64 | − Token::Author { signature } | Token::Committer { signature } => Some(signature), | |
| 65 | − _ => None, | |
| 66 | − }) | |
| 61 | + self.filter_map(|t| match t { | |
| 62 | + Ok(Token::Author { signature }) | Ok(Token::Committer { signature }) => Some(signature), | |
| 63 | + _ => None, | |
| 64 | + }) | |
| 67 | 65 | } |
| 68 | 66 | |
| 69 | 67 | /// Returns the committer signature if there is no decoding error. |