From be638d02058f8c9de3db5bbe75d2a21b89b1b0b0 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Sat, 28 Jan 2023 14:56:03 -0800 Subject: [PATCH] dag_walk: delete unused `common_ancestor()` --- lib/src/dag_walk.rs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/lib/src/dag_walk.rs b/lib/src/dag_walk.rs index 87e49c1b8..e333832e0 100644 --- a/lib/src/dag_walk.rs +++ b/lib/src/dag_walk.rs @@ -16,8 +16,6 @@ use std::collections::HashSet; use std::hash::Hash; use std::iter::Iterator; -use crate::commit::Commit; - pub struct BfsIter<'id_fn, 'neighbors_fn, T, ID, NI> { id_fn: Box ID + 'id_fn>, neighbors_fn: Box NI + 'neighbors_fn>, @@ -174,19 +172,6 @@ where reachable } -pub fn common_ancestor<'a, I1, I2>(set1: I1, set2: I2) -> Commit -where - I1: IntoIterator, - I2: IntoIterator, -{ - let set1: Vec = set1.into_iter().cloned().collect(); - let set2: Vec = set2.into_iter().cloned().collect(); - closest_common_node(set1, set2, &|commit| commit.parents(), &|commit| { - commit.id().clone() - }) - .unwrap() -} - pub fn closest_common_node( set1: II1, set2: II2,