@@ -13,15 +13,15 @@ pub struct Platform<'r> {
1313}
1414
1515/// An iterator over references, with or without filter.
16- pub struct Iter < ' r > {
17- inner : gix_ref:: file:: iter:: LooseThenPacked < ' r , ' r > ,
16+ pub struct Iter < ' packed , ' repo > {
17+ inner : gix_ref:: file:: iter:: LooseThenPacked < ' packed , ' repo > ,
1818 peel_with_packed : Option < gix_ref:: file:: packed:: SharedBufferSnapshot > ,
1919 peel : bool ,
20- repo : & ' r crate :: Repository ,
20+ repo : & ' repo crate :: Repository ,
2121}
2222
23- impl < ' r > Iter < ' r > {
24- fn new ( repo : & ' r crate :: Repository , platform : gix_ref:: file:: iter:: LooseThenPacked < ' r , ' r > ) -> Self {
23+ impl < ' packed , ' repo > Iter < ' packed , ' repo > {
24+ fn new ( repo : & ' repo crate :: Repository , platform : gix_ref:: file:: iter:: LooseThenPacked < ' packed , ' repo > ) -> Self {
2525 Iter {
2626 inner : platform,
2727 peel_with_packed : None ,
@@ -31,13 +31,13 @@ impl<'r> Iter<'r> {
3131 }
3232}
3333
34- impl Platform < ' _ > {
34+ impl < ' repo > Platform < ' repo > {
3535 /// Return an iterator over all references in the repository, excluding
3636 /// pseudo references.
3737 ///
3838 /// Even broken or otherwise unparsable or inaccessible references are returned and have to be handled by the caller on a
3939 /// case by case basis.
40- pub fn all ( & self ) -> Result < Iter < ' _ > , init:: Error > {
40+ pub fn all ( & self ) -> Result < Iter < ' _ , ' repo > , init:: Error > {
4141 Ok ( Iter :: new ( self . repo , self . platform . all ( ) ?) )
4242 }
4343
@@ -47,23 +47,22 @@ impl Platform<'_> {
4747 pub fn prefixed < ' a > (
4848 & self ,
4949 prefix : impl TryInto < & ' a RelativePath , Error = gix_path:: relative_path:: Error > ,
50- ) -> Result < Iter < ' _ > , init:: Error > {
50+ ) -> Result < Iter < ' _ , ' repo > , init:: Error > {
5151 Ok ( Iter :: new ( self . repo , self . platform . prefixed ( prefix. try_into ( ) ?) ?) )
5252 }
5353
54- // TODO: tests
5554 /// Return an iterator over all references that are tags.
5655 ///
5756 /// They are all prefixed with `refs/tags`.
58- pub fn tags ( & self ) -> Result < Iter < ' _ > , init:: Error > {
57+ pub fn tags ( & self ) -> Result < Iter < ' _ , ' repo > , init:: Error > {
5958 Ok ( Iter :: new ( self . repo , self . platform . prefixed ( b"refs/tags/" . try_into ( ) ?) ?) )
6059 }
6160
6261 // TODO: tests
6362 /// Return an iterator over all local branches.
6463 ///
6564 /// They are all prefixed with `refs/heads`.
66- pub fn local_branches ( & self ) -> Result < Iter < ' _ > , init:: Error > {
65+ pub fn local_branches ( & self ) -> Result < Iter < ' _ , ' repo > , init:: Error > {
6766 Ok ( Iter :: new (
6867 self . repo ,
6968 self . platform . prefixed ( b"refs/heads/" . try_into ( ) ?) ?,
@@ -72,23 +71,23 @@ impl Platform<'_> {
7271
7372 // TODO: tests
7473 /// Return an iterator over all local pseudo references.
75- pub fn pseudo ( & self ) -> Result < Iter < ' _ > , init:: Error > {
74+ pub fn pseudo ( & self ) -> Result < Iter < ' _ , ' repo > , init:: Error > {
7675 Ok ( Iter :: new ( self . repo , self . platform . pseudo ( ) ?) )
7776 }
7877
7978 // TODO: tests
8079 /// Return an iterator over all remote branches.
8180 ///
8281 /// They are all prefixed with `refs/remotes`.
83- pub fn remote_branches ( & self ) -> Result < Iter < ' _ > , init:: Error > {
82+ pub fn remote_branches ( & self ) -> Result < Iter < ' _ , ' repo > , init:: Error > {
8483 Ok ( Iter :: new (
8584 self . repo ,
8685 self . platform . prefixed ( b"refs/remotes/" . try_into ( ) ?) ?,
8786 ) )
8887 }
8988}
9089
91- impl Iter < ' _ > {
90+ impl Iter < ' _ , ' _ > {
9291 /// Automatically peel references before yielding them during iteration.
9392 ///
9493 /// This has the same effect as using `iter.map(|r| {r.peel_to_id_in_place(); r})`.
@@ -104,7 +103,7 @@ impl Iter<'_> {
104103 }
105104}
106105
107- impl < ' r > Iterator for Iter < ' r > {
106+ impl < ' r > Iterator for Iter < ' _ , ' r > {
108107 type Item = Result < crate :: Reference < ' r > , Box < dyn std:: error:: Error + Send + Sync + ' static > > ;
109108
110109 fn next ( & mut self ) -> Option < Self :: Item > {
0 commit comments