summaryrefslogtreecommitdiff
path: root/src/map.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-10-04 10:08:58 +0300
committerLars Wirzenius <liw@liw.fi>2019-10-04 10:08:58 +0300
commit8e4095e17b087cdab0d568f21e6717d0b5f3dab7 (patch)
treea78994be0c399bc658d2a518c5b96670057c8ba3 /src/map.rs
parent5e34e8c7ff530201a140afb8bc170e0461762b69 (diff)
downloadroadmap-8e4095e17b087cdab0d568f21e6717d0b5f3dab7.tar.gz
Change: rename as_dot to format_as_dot
Diffstat (limited to 'src/map.rs')
-rw-r--r--src/map.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/map.rs b/src/map.rs
index 994633b..4ed4c7f 100644
--- a/src/map.rs
+++ b/src/map.rs
@@ -119,7 +119,7 @@ impl Roadmap {
/// Get a Graphviz dot language representation of a roadmap. This
/// is the textual representation, and the caller needs to use the
/// Graphviz dot(1) tool to create an image from it.
- pub fn as_dot(&self, label_width: usize) -> Result<String, Box<dyn std::error::Error>> {
+ pub fn format_as_dot(&self, label_width: usize) -> Result<String, Box<dyn std::error::Error>> {
let labels = self.steps.iter().map(|step| {
format!(
"{} [label=\"{}\" style=filled fillcolor=\"{}\" shape=\"{}\"];\n",
@@ -238,7 +238,7 @@ blocked:
fn empty_dot() {
let roadmap = Roadmap::new();
assert_eq!(
- roadmap.as_dot(999).unwrap(),
+ roadmap.format_as_dot(999).unwrap(),
"digraph \"roadmap\" {
}
"
@@ -256,7 +256,7 @@ blocked:
roadmap.add_step(first);
roadmap.add_step(second);
assert_eq!(
- roadmap.as_dot(999).unwrap(),
+ roadmap.format_as_dot(999).unwrap(),
"digraph \"roadmap\" {
first [label=\"\" style=filled fillcolor=\"#ffffff\" shape=\"ellipse\"];
second [label=\"\" style=filled fillcolor=\"#00eeee\" shape=\"diamond\"];