Fix clippy findings and related issues

This commit is contained in:
2026-10-13 21:25:50 +02:00
parent 7cfee9cce5
commit 3d1e8246a8
11 changed files with 179 additions and 254 deletions
+8 -7
View File
@@ -5,6 +5,8 @@ use crate::models::{AppendGraph, FrozenGraph};
use crate::traits::{GraphTopology, GraphTopologyAddition, GraphTopologyConversion, Incidence};
pub trait MakeTestGraph: GraphTopology + Sized {
// Since this is only a test fixture, the complex return type here is deemed acceptable.
#[allow(clippy::type_complexity)]
fn standard() -> (
Self,
[Self::Vertex; 10],
@@ -293,12 +295,12 @@ pub fn assert_standard_unweighted_predecessors_v0<V: Debug + Copy + PartialEq>(
vec![Some(vertices[4])],
vec![Some(vertices[5]), Some(vertices[6]), Some(vertices[7])],
];
for i in 0..10 {
assert_eq!(vertices.len(), expected.len());
for (&v, exp) in vertices.iter().zip(&expected) {
assert!(
expected[i].contains(&actual[vertices[i]]),
"unexpected predecessor {:?} of vertex {:?}",
actual[vertices[i]],
vertices[i]
exp.contains(&actual[v]),
"unexpected predecessor {:?} of vertex {v:?}",
actual[v]
);
}
}
@@ -320,8 +322,7 @@ where
{
let path = path_option.unwrap_or_else(|| {
panic!(
"path should exist between source vertex {:?} and connected targets {:?}",
source, targets
"path should exist between source vertex {source:?} and connected targets {targets:?}"
)
});