Fix clippy findings and related issues
This commit is contained in:
@@ -43,10 +43,11 @@ pub fn reserve_vertices_increases_capacity<G: GraphTopologyAddition>() {
|
||||
}
|
||||
|
||||
pub fn reserve_vertices_prevents_reallocation_on_add<G: GraphTopologyAddition>() {
|
||||
const N: usize = 10;
|
||||
let mut graph = G::default();
|
||||
graph.reserve_vertices(10);
|
||||
graph.reserve_vertices(N);
|
||||
let capacity_before = graph.vertex_capacity();
|
||||
for _ in 0..10 {
|
||||
for _ in 0..N {
|
||||
graph.add_vertex();
|
||||
}
|
||||
assert_eq!(
|
||||
@@ -78,12 +79,13 @@ pub fn reserve_edges_increases_capacity<G: GraphTopologyAddition>() {
|
||||
}
|
||||
|
||||
pub fn reserve_edges_prevents_reallocation_on_add<G: GraphTopologyAddition>() {
|
||||
const N: usize = 10;
|
||||
let mut graph = G::default();
|
||||
let u = graph.add_vertex();
|
||||
let v = graph.add_vertex();
|
||||
graph.reserve_edges(10);
|
||||
graph.reserve_edges(N);
|
||||
let capacity_before = graph.edge_capacity();
|
||||
for _ in 0..10 {
|
||||
for _ in 0..N {
|
||||
graph.add_edge(u, v);
|
||||
}
|
||||
assert_eq!(
|
||||
|
||||
Reference in New Issue
Block a user