use super::*;
pub(super) fn empty_subgraph() -> Subgraph {
Subgraph {
nodes: HashMap::new(),
edges: Vec::new(),
roots: Vec::new(),
confidence: None,
}
}
pub(super) fn resolve_root(project_root: impl AsRef<Path>) -> PathBuf {
let path = project_root.as_ref();
if path.is_absolute() {
path.to_path_buf()
} else {
std::env::current_dir()
.unwrap_or_else(|_| PathBuf::from("."))
.join(path)
}
}
#[allow(dead_code)]
pub(super) fn default_traversal_options() -> TraversalOptions {
TraversalOptions {
max_depth: None,
edge_kinds: None,
node_kinds: None,
direction: Some(TraversalDirection::Both),
limit: None,
include_start: Some(true),
}
}