Skip to content

Commit 161d978

Browse files
committed
refactor(bisect): rename search::SearchGraph -> search::Graph
For uniformity with the other symbols in this module (`Strategy` etc.).
1 parent a51285a commit 161d978

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

git-branchless-test/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ struct SearchGraph<'a> {
11641164
commit_set: CommitSet,
11651165
}
11661166

1167-
impl<'a> search::SearchGraph for SearchGraph<'a> {
1167+
impl<'a> search::Graph for SearchGraph<'a> {
11681168
type Node = NonZeroOid;
11691169
type Error = SearchGraphError;
11701170

scm-bisect/src/search.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use thiserror::Error;
1111
use tracing::instrument;
1212

1313
/// The set of nodes compromising a directed acyclic graph to be searched.
14-
pub trait SearchGraph: Debug {
14+
pub trait Graph: Debug {
1515
/// The type of nodes in the graph. This should be cheap to clone.
1616
type Node: Clone + Debug + Hash + Eq;
1717

@@ -272,16 +272,16 @@ pub enum Error2<Node, Error> {
272272
}
273273

274274
/// The error type for the search.
275-
pub type Error<G> = Error2<<G as SearchGraph>::Node, <G as SearchGraph>::Error>;
275+
pub type Error<G> = Error2<<G as Graph>::Node, <G as Graph>::Error>;
276276

277277
/// The search algorithm.
278278
#[derive(Clone, Debug)]
279-
pub struct Search<G: SearchGraph> {
279+
pub struct Search<G: Graph> {
280280
graph: G,
281281
nodes: IndexMap<G::Node, Status>,
282282
}
283283

284-
impl<G: SearchGraph> Search<G> {
284+
impl<G: Graph> Search<G> {
285285
/// Construct a new search.
286286
pub fn new(graph: G, nodes: impl IntoIterator<Item = G::Node>) -> Self {
287287
let nodes = nodes
@@ -451,7 +451,7 @@ mod tests {
451451
max: usize,
452452
}
453453

454-
impl SearchGraph for UsizeGraph {
454+
impl Graph for UsizeGraph {
455455
type Node = usize;
456456
type Error = Infallible;
457457

@@ -602,7 +602,7 @@ mod tests {
602602
nodes: HashMap<char, HashSet<char>>,
603603
}
604604

605-
impl SearchGraph for TestGraph {
605+
impl Graph for TestGraph {
606606
type Node = char;
607607
type Error = Infallible;
608608

0 commit comments

Comments
 (0)