summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorseancarroll <seanc28@gmail.com>2021-03-23 23:22:09 -0500
committerseancarroll <seanc28@gmail.com>2021-03-23 23:22:09 -0500
commit889162257cda19bafd4ff344cb878565f2562794 (patch)
tree4a322537d9092637b8eeb510122db02a2936f148 /README.md
parent2f7ecf77781f181b8de178e0ec2f4a37a958a412 (diff)
downloaddotavious-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.md11
1 files changed, 6 insertions, 5 deletions
diff --git a/README.md b/README.md
index a8327b9..b25bff4 100644
--- a/README.md
+++ b/README.md
@@ -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)