History

More speedy access to author/committer (#364)

Sebastian Thiel committed 4 years ago

Commit 61296071 parent 3079e114 files · +34 −16Browse files

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

Unified · Split

git-object/src/commit/ref_iter.rs+3−3
@@ -77,7 +77,7 @@ impl<'a> CommitRefIter<'a> { · 76 unmodified lines
77 77
78 /// Returns the committer signature if there is no decoding error.78 /// Returns the committer signature if there is no decoding error.
79 /// Errors are coerced into options, hiding whether there was an error or not. The caller knows if there was an error or not.79 /// Errors are coerced into options, hiding whether there was an error or not. The caller knows if there was an error or not.
80 pub fn committer(&mut self) -> Option<git_actor::SignatureRef<'_>> {80 pub fn committer(mut self) -> Option<git_actor::SignatureRef<'a>> {
81 self.find_map(|t| match t {81 self.find_map(|t| match t {
82 Ok(Token::Committer { signature }) => Some(signature),82 Ok(Token::Committer { signature }) => Some(signature),
83 _ => None,83 _ => None,
@@ -86,7 +86,7 @@ impl<'a> CommitRefIter<'a> { · 2 unmodified lines
86 86
87 /// Returns the author signature if there is no decoding error.87 /// Returns the author signature if there is no decoding error.
88 /// Errors are coerced into options, hiding whether there was an error or not. The caller knows if there was an error or not.88 /// Errors are coerced into options, hiding whether there was an error or not. The caller knows if there was an error or not.
89 pub fn author(&mut self) -> Option<git_actor::SignatureRef<'_>> {89 pub fn author(mut self) -> Option<git_actor::SignatureRef<'a>> {
90 self.find_map(|t| match t {90 self.find_map(|t| match t {
91 Ok(Token::Author { signature }) => Some(signature),91 Ok(Token::Author { signature }) => Some(signature),
92 _ => None,92 _ => None,
@@ -95,7 +95,7 @@ impl<'a> CommitRefIter<'a> { · 2 unmodified lines
95 95
96 /// Returns the message if there is no decoding error.96 /// Returns the message if there is no decoding error.
97 /// Errors are coerced into options, hiding whether there was an error or not. The caller knows if there was an error or not.97 /// Errors are coerced into options, hiding whether there was an error or not. The caller knows if there was an error or not.
98 pub fn message(&mut self) -> Option<&'a BStr> {98 pub fn message(mut self) -> Option<&'a BStr> {
99 self.find_map(|t| match t {99 self.find_map(|t| match t {
100 Ok(Token::Message(msg)) => Some(msg),100 Ok(Token::Message(msg)) => Some(msg),
101 _ => None,101 _ => None,