History

[actor #173] rename immutable::Signature to SignatureRef!

Sebastian Thiel committed 5 years ago

Commit 96461ac1 parent c2bc1a629 files · +258 −262Browse files

Showing the changes to git-object/src/immutable/commit (2 of 29 files). Show all

Unified · Split

2 files
  1. git-object/src/immutable/commit/iter.rs +4 −4
  2. git-object/src/immutable/commit/mod.rs +2 −2
git-object/src/immutable/commit/iter.rs+4−4
@@ -35,7 +35,7 @@ impl Default for State { · 34 unmodified lines
35 }35 }
36}36}
37 37
38/// Like [`immutable::Commit`][super::Commit], but as `Iterator` to support (up to) entirely allocation free parsing.38/// Like [`signature_ref::Commit`][super::Commit], but as `Iterator` to support (up to) entirely allocation free parsing.
39/// It's particularly useful to traverse the commit graph without ever allocating arrays for parents.39/// It's particularly useful to traverse the commit graph without ever allocating arrays for parents.
40pub struct Iter<'a> {40pub struct Iter<'a> {
41 data: &'a [u8],41 data: &'a [u8],
@@ -67,7 +67,7 @@ impl<'a> Iter<'a> { · 25 unmodified lines
67 /// Errors are coerced into options, hiding whether there was an error or not. The caller knows if there was an error or not67 /// Errors are coerced into options, hiding whether there was an error or not. The caller knows if there was an error or not
68 /// if not exactly two signatures were iterable.68 /// if not exactly two signatures were iterable.
69 /// Errors are not the common case - if an error needs to be detectable, use this instance as iterator.69 /// Errors are not the common case - if an error needs to be detectable, use this instance as iterator.
70 pub fn signatures(&'a mut self) -> impl Iterator<Item = git_actor::immutable::Signature<'_>> + 'a {70 pub fn signatures(&'a mut self) -> impl Iterator<Item = git_actor::SignatureRef<'_>> + 'a {
71 self.filter_map(Result::ok)71 self.filter_map(Result::ok)
72 .skip_while(|t| !matches!(t, Token::Author { .. } | Token::Committer { .. }))72 .skip_while(|t| !matches!(t, Token::Author { .. } | Token::Committer { .. }))
73 .filter_map(|t| match t {73 .filter_map(|t| match t {
@@ -208,11 +208,11 @@ pub enum Token<'a> { · 134 unmodified lines
208 },208 },
209 /// A person who authored the content of the commit.209 /// A person who authored the content of the commit.
210 Author {210 Author {
211 signature: git_actor::immutable::Signature<'a>,211 signature: git_actor::SignatureRef<'a>,
212 },212 },
213 /// A person who committed the authors work to the repository.213 /// A person who committed the authors work to the repository.
214 Committer {214 Committer {
215 signature: git_actor::immutable::Signature<'a>,215 signature: git_actor::SignatureRef<'a>,
216 },216 },
217 Encoding(&'a BStr),217 Encoding(&'a BStr),
218 ExtraHeader((&'a BStr, Cow<'a, BStr>)),218 ExtraHeader((&'a BStr, Cow<'a, BStr>)),
git-object/src/immutable/commit/mod.rs+2−2
@@ -24,12 +24,12 @@ pub struct Commit<'a> { · 23 unmodified lines
24 /// HEX hash of each parent commit. Empty for first commit in repository.24 /// HEX hash of each parent commit. Empty for first commit in repository.
25 pub parents: SmallVec<[&'a BStr; 2]>,25 pub parents: SmallVec<[&'a BStr; 2]>,
26 /// Who wrote this commit.26 /// Who wrote this commit.
27 pub author: git_actor::immutable::Signature<'a>,27 pub author: git_actor::SignatureRef<'a>,
28 /// Who committed this commit.28 /// Who committed this commit.
29 ///29 ///
30 /// This may be different from the `author` in case the author couldn't write to the repository themselves and30 /// This may be different from the `author` in case the author couldn't write to the repository themselves and
31 /// is commonly encountered with contributed commits.31 /// is commonly encountered with contributed commits.
32 pub committer: git_actor::immutable::Signature<'a>,32 pub committer: git_actor::SignatureRef<'a>,
33 /// The name of the message encoding, otherwise [UTF-8 should be assumed](https://github.com/git/git/blob/e67fbf927dfdf13d0b21dc6ea15dc3c7ef448ea0/commit.c#L1493:L1493).33 /// The name of the message encoding, otherwise [UTF-8 should be assumed](https://github.com/git/git/blob/e67fbf927dfdf13d0b21dc6ea15dc3c7ef448ea0/commit.c#L1493:L1493).
34 pub encoding: Option<&'a BStr>,34 pub encoding: Option<&'a BStr>,
35 /// The commit message documenting the change.35 /// The commit message documenting the change.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t