Skip to content

Commit a70d2a1

Browse files
committed
Rename find_shortest_path
Remove the "bidirectional" from the function name, since this is the only path finding function we have. The "bidirectional" part is just an implementation detail.
1 parent 0851815 commit a70d2a1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

rust/src/graph/import_chain_queries.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::errors::GrimpResult;
2-
use crate::graph::pathfinding::{find_reach, find_shortest_path_bidirectional};
2+
use crate::graph::pathfinding::{find_reach, find_shortest_path};
33
use crate::graph::{ExtendWithDescendants, Graph, ModuleToken};
44
use itertools::Itertools;
55
use rustc_hash::{FxHashMap, FxHashSet};
@@ -62,7 +62,7 @@ impl Graph {
6262
excluded_modules: &FxHashSet<ModuleToken>,
6363
excluded_imports: &FxHashMap<ModuleToken, FxHashSet<ModuleToken>>,
6464
) -> GrimpResult<Option<Vec<ModuleToken>>> {
65-
find_shortest_path_bidirectional(
65+
find_shortest_path(
6666
self,
6767
from_modules,
6868
to_modules,

rust/src/graph/pathfinding.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ pub fn find_reach(
2828
&seen.into_iter().collect::<FxHashSet<_>>() - from_modules
2929
}
3030

31-
pub fn find_shortest_path_bidirectional(
31+
/// Finds the shortest path, via a bidirectional BFS.
32+
pub fn find_shortest_path(
3233
graph: &Graph,
3334
from_modules: &FxHashSet<ModuleToken>,
3435
to_modules: &FxHashSet<ModuleToken>,

0 commit comments

Comments
 (0)