diff options
author | seancarroll <seanc28@gmail.com> | 2021-03-23 23:22:09 -0500 |
---|---|---|
committer | seancarroll <seanc28@gmail.com> | 2021-03-23 23:22:09 -0500 |
commit | 889162257cda19bafd4ff344cb878565f2562794 (patch) | |
tree | 4a322537d9092637b8eeb510122db02a2936f148 /README.md | |
parent | 2f7ecf77781f181b8de178e0ec2f4a37a958a412 (diff) | |
download | dotavious-889162257cda19bafd4ff344cb878565f2562794.zip |
support Into<String> in more scenarios to remove the need for users to always have to perform a .to_string
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -22,11 +22,11 @@ use dotavious::{Dot, Edge, Graph, GraphBuilder, Node}; use std::io; use std::io::Read; -// can also start building a undirected graph via `GraphBuilder::new_undirected` -let graph = GraphBuilder::new_directed(Some("example".to_string())) - .add_node(Node::new("N0".to_string())) - .add_node(Node::new("N1".to_string())) - .add_edge(Edge::new("N0".to_string(), "N1".to_string())) +// can also start building a named undirected graph via `GraphBuilder::new_named_undirected` +let graph = GraphBuilder::new_named_directed("example") + .add_node(Node::new("N0")) + .add_node(Node::new("N1")) + .add_edge(Edge::new("N0", "N1")) .build() .unwrap(); @@ -42,4 +42,5 @@ digraph example { } ``` and when rendered will look like + ![README example rendered](readme-example.png?raw=true) |