summaryrefslogtreecommitdiff
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
parent5e34e8c7ff530201a140afb8bc170e0461762b69 (diff)
downloadroadmap-8e4095e17b087cdab0d568f21e6717d0b5f3dab7.tar.gz
Change: rename as_dot to format_as_dot
-rw-r--r--src/bin/roadmap2dot.rs2
-rw-r--r--src/lib.rs2
-rw-r--r--src/map.rs6
3 files changed, 5 insertions, 5 deletions
diff --git a/src/bin/roadmap2dot.rs b/src/bin/roadmap2dot.rs
index 64b55d1..244a300 100644
--- a/src/bin/roadmap2dot.rs
+++ b/src/bin/roadmap2dot.rs
@@ -38,7 +38,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut r = from_yaml(&text)?;
r.set_missing_statuses();
- println!("{}", r.as_dot(LABEL_WIDTH).unwrap());
+ println!("{}", r.format_as_dot(LABEL_WIDTH).unwrap());
Ok(())
}
diff --git a/src/lib.rs b/src/lib.rs
index c9caef1..cf5500d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -25,7 +25,7 @@
//! assert!(n.contains(&"endgoal"));
//!
//! r.set_missing_statuses();
-//! println!("{}", r.as_dot(30).unwrap());
+//! println!("{}", r.format_as_dot(30).unwrap());
//!
//! # Ok(())
//! # }
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\"];