Skip to content

Commit

Permalink
commit: actually remove boxing from CommitIteratorExt::ids()
Browse files Browse the repository at this point in the history
Also simplified lifetime bound a bit.
  • Loading branch information
yuja committed Apr 4, 2024
1 parent 32afea1 commit 06f0ab0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/src/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ impl Commit {
}

pub trait CommitIteratorExt<'c, I> {
fn ids(self) -> impl Iterator<Item = &'c CommitId> + 'c;
fn ids(self) -> impl Iterator<Item = &'c CommitId>;
}

impl<'c, I> CommitIteratorExt<'c, I> for I
where
I: Iterator<Item = &'c Commit> + 'c,
I: Iterator<Item = &'c Commit>,
{
fn ids(self) -> impl Iterator<Item = &'c CommitId> + 'c {
Box::new(self.map(|commit| commit.id()))
fn ids(self) -> impl Iterator<Item = &'c CommitId> {
self.map(|commit| commit.id())
}
}

Expand Down

0 comments on commit 06f0ab0

Please sign in to comment.