Skip to content

Commit a3c2fb0

Browse files
committed
Updated dot example
1 parent 380d440 commit a3c2fb0

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

examples/dot.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,24 @@ pub fn main() {
1111
let v2 = graph.add_vertex("test2".to_string());
1212
let v3 = graph.add_vertex("test3".to_string());
1313
let v4 = graph.add_vertex("test4".to_string());
14-
1514
let v5 = graph.add_vertex("test5".to_string());
1615
let v6 = graph.add_vertex("test6".to_string());
1716

17+
#[cfg(feature = "dot")]
18+
{
19+
graph.label_vertex(&v1, "test1").unwrap();
20+
graph.label_vertex(&v2, "test2").unwrap();
21+
graph.label_vertex(&v3, "test3").unwrap();
22+
graph.label_vertex(&v4, "test4").unwrap();
23+
graph.label_vertex(&v5, "test5").unwrap();
24+
graph.label_vertex(&v6, "test6").unwrap();
25+
}
26+
1827
graph.add_edge(&v1, &v2).unwrap();
1928
graph.add_edge(&v3, &v1).unwrap();
2029
graph.add_edge(&v1, &v4).unwrap();
2130
graph.add_edge(&v5, &v6).unwrap();
2231

2332
#[cfg(feature = "dot")]
24-
graph.to_dot("example1", &mut f);
33+
graph.to_dot("example1", &mut f).unwrap();
2534
}

0 commit comments

Comments
 (0)