From 71934ae0ab8ed2a8866603571fb9d5b9f9dbe7a1 Mon Sep 17 00:00:00 2001 From: Dmitrii Samsonov Date: Tue, 29 Oct 2024 21:47:35 +0200 Subject: [PATCH] fixed tests --- src/helpers.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index cdadaa3..b27297a 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -28,19 +28,19 @@ use std::collections::HashMap; /// /// let result: Graph<_, _, _, _, DefaultNodeShape, DefaultEdgeShape> = to_graph(&g); /// -/// assert_eq!(result.g.node_count(), 2); -/// assert_eq!(result.g.edge_count(), 1); +/// assert_eq!(result.node_count(), 2); +/// assert_eq!(result.edge_count(), 1); /// -/// let mut indxs = result.g.node_indices(); +/// let mut indxs = result.node_indices(); /// let result_node1 = indxs.next().unwrap(); /// let result_node2 = indxs.next().unwrap(); -/// assert_eq!(*result.g.node_weight(result_node1).unwrap().payload(), "A"); -/// assert_eq!(*result.g.node_weight(result_node2).unwrap().payload(), "B"); +/// assert_eq!(*result.node(result_node1).unwrap().payload(), "A"); +/// assert_eq!(*result.node(result_node2).unwrap().payload(), "B"); /// -/// assert_eq!(*result.g.edge_weight(result.g.edge_indices().next().unwrap()).unwrap().payload(), "edge1"); +/// assert_eq!(*result.edge(result.edge_indices().next().unwrap()).unwrap().payload(), "edge1"); /// -/// assert_eq!(*result.g.node_weight(result_node1).unwrap().label().clone(), format!("node {}", result_node1.index())); -/// assert_eq!(*result.g.node_weight(result_node2).unwrap().label().clone(), format!("node {}", result_node2.index())); +/// assert_eq!(*result.node(result_node1).unwrap().label().clone(), format!("node {}", result_node1.index())); +/// assert_eq!(*result.node(result_node2).unwrap().label().clone(), format!("node {}", result_node2.index())); /// ``` pub fn to_graph(g: &StableGraph) -> Graph where