Skip to content

Commit 6541dda

Browse files
committed
impl Default for StableGraph
1 parent f85d340 commit 6541dda

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/stable.rs

+8
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,14 @@ impl<N, E, Ty, Ix> IndexMut<EdgeIndex<Ix>> for StableGraph<N, E, Ty, Ix> where
405405
}
406406
}
407407

408+
/// Create a new empty `StableGraph`.
409+
impl<N, E, Ty, Ix> Default for StableGraph<N, E, Ty, Ix>
410+
where Ty: EdgeType,
411+
Ix: IndexType,
412+
{
413+
fn default() -> Self { Self::with_capacity(0, 0) }
414+
}
415+
408416
/// Iterator over the neighbors of a node.
409417
///
410418
/// Iterator element type is `NodeIndex`.

0 commit comments

Comments
 (0)