Remove function calls inside of 'expect'
This commit is contained in:
@@ -318,10 +318,12 @@ where
|
||||
G::Vertex: Debug,
|
||||
G::Edge: Debug,
|
||||
{
|
||||
let path = path_option.expect(&format!(
|
||||
"path should exist between source vertex {:?} and connected targets {:?}",
|
||||
source, targets
|
||||
));
|
||||
let path = path_option.unwrap_or_else(|| {
|
||||
panic!(
|
||||
"path should exist between source vertex {:?} and connected targets {:?}",
|
||||
source, targets
|
||||
)
|
||||
});
|
||||
|
||||
if targets.contains(&source) {
|
||||
assert!(
|
||||
@@ -402,9 +404,9 @@ pub fn assert_isomorphic<G: GraphTopology, H: GraphTopology>(
|
||||
.position(|x| {
|
||||
vertex_map(x.vertex) == incidence.vertex && edge_map(x.edge) == incidence.edge
|
||||
})
|
||||
.expect(&format!(
|
||||
"unexpected incidence {incidence:?} of vertex {v:?} in the other graph"
|
||||
));
|
||||
.unwrap_or_else(|| {
|
||||
panic!("unexpected incidence {incidence:?} of vertex {v:?} in the other graph")
|
||||
});
|
||||
expected.swap_remove(pos);
|
||||
}
|
||||
assert!(
|
||||
|
||||
Reference in New Issue
Block a user