Add show command

This commit is contained in:
Joscha 2024-12-31 14:48:59 +01:00
parent aa4187fcd8
commit ceb987bbbc
5 changed files with 93 additions and 9 deletions

View file

@ -193,4 +193,12 @@ impl Data {
let mut file = BufReader::new(File::open(path)?);
Self::read(&mut file)
}
pub fn redirect_target(&self, node: NodeIdx) -> Option<NodeIdx> {
if !self.pages[node.usize()].redirect {
return None;
}
self.graph.edge_slice(node).first().copied()
}
}