Merge WithNumNodes into DirectedGraph

This commit is contained in:
Maybe Waffle
2024-04-14 15:15:03 +00:00
parent 029cb1b13b
commit 398da593a5
13 changed files with 33 additions and 52 deletions

View File

@@ -1,4 +1,4 @@
use crate::graph::{DirectedGraph, GraphSuccessors, WithNumEdges, WithNumNodes, WithSuccessors};
use crate::graph::{DirectedGraph, GraphSuccessors, WithNumEdges, WithSuccessors};
use rustc_index::{Idx, IndexVec};
#[cfg(test)]
@@ -80,9 +80,7 @@ impl<N: Idx + Ord> VecGraph<N> {
impl<N: Idx> DirectedGraph for VecGraph<N> {
type Node = N;
}
impl<N: Idx> WithNumNodes for VecGraph<N> {
fn num_nodes(&self) -> usize {
self.node_starts.len() - 1
}