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