Skip to content

Commit

Permalink
repository!: rename ObjectIdExt::ancestors_iter() to *::ancestors() (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Sep 13, 2021
1 parent 1a1959f commit a19567e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion experiments/diffing/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn main() -> anyhow::Result<()> {

let start = Instant::now();
let all_commits = commit_id
.ancestors_iter(|oid, buf| db.find_commit_iter(oid, buf, &mut odb::pack::cache::Never).ok())
.ancestors(|oid, buf| db.find_commit_iter(oid, buf, &mut odb::pack::cache::Never).ok())
.collect::<Result<Vec<_>, _>>()?;
let num_diffs = all_commits.len();
let elapsed = start.elapsed();
Expand Down
4 changes: 2 additions & 2 deletions experiments/traversal/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn main() -> anyhow::Result<()> {

let start = Instant::now();
let all_commits = commit_id
.ancestors_iter(|oid, buf| db.find_commit_iter(oid, buf, &mut odb::pack::cache::Never).ok())
.ancestors(|oid, buf| db.find_commit_iter(oid, buf, &mut odb::pack::cache::Never).ok())
.collect::<Result<Vec<_>, _>>()?;
let elapsed = start.elapsed();
println!(
Expand Down Expand Up @@ -146,7 +146,7 @@ where
C: odb::pack::cache::DecodeEntry,
{
let mut cache = new_cache();
let ancestors = tip.ancestors_iter(|oid, buf| db.find_commit_iter(oid, buf, &mut cache).ok());
let ancestors = tip.ancestors(|oid, buf| db.find_commit_iter(oid, buf, &mut cache).ok());
let mut commits = 0;
for commit_id in ancestors {
let _ = commit_id?;
Expand Down
4 changes: 2 additions & 2 deletions git-repository/src/ext/object_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::easy;
pub trait Sealed {}

pub trait ObjectIdExt: Sealed {
fn ancestors_iter<Find>(self, find: Find) -> Ancestors<Find, fn(&git_hash::oid) -> bool, State>
fn ancestors<Find>(self, find: Find) -> Ancestors<Find, fn(&git_hash::oid) -> bool, State>
where
Find: for<'a> FnMut(&git_hash::oid, &'a mut Vec<u8>) -> Option<git_object::CommitRefIter<'a>>;

Expand All @@ -17,7 +17,7 @@ pub trait ObjectIdExt: Sealed {
impl Sealed for ObjectId {}

impl ObjectIdExt for ObjectId {
fn ancestors_iter<Find>(self, find: Find) -> Ancestors<Find, fn(&git_hash::oid) -> bool, State>
fn ancestors<Find>(self, find: Find) -> Ancestors<Find, fn(&git_hash::oid) -> bool, State>
where
Find: for<'a> FnMut(&git_hash::oid, &'a mut Vec<u8>) -> Option<git_object::CommitRefIter<'a>>,
{
Expand Down
2 changes: 1 addition & 1 deletion gitoxide-core/src/hours.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ where
let mut pack_cache = odb::pack::cache::Never;
let mut commits: Vec<Vec<u8>> = Vec::new();
for c in interrupt::Iter::new(
commit_id.ancestors_iter(|oid, buf| {
commit_id.ancestors(|oid, buf| {
progress.inc();
repo.odb.find(oid, buf, &mut pack_cache).ok().map(|o| {
commits.push(o.data.to_owned());
Expand Down

0 comments on commit a19567e

Please sign in to comment.