diff options
author | Lars Wirzenius <liw@liw.fi> | 2019-10-04 10:08:58 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2019-10-04 10:08:58 +0300 |
commit | 8e4095e17b087cdab0d568f21e6717d0b5f3dab7 (patch) | |
tree | a78994be0c399bc658d2a518c5b96670057c8ba3 /src | |
parent | 5e34e8c7ff530201a140afb8bc170e0461762b69 (diff) | |
download | roadmap-8e4095e17b087cdab0d568f21e6717d0b5f3dab7.tar.gz |
Change: rename as_dot to format_as_dot
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/roadmap2dot.rs | 2 | ||||
-rw-r--r-- | src/lib.rs | 2 | ||||
-rw-r--r-- | src/map.rs | 6 |
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(()) } @@ -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(()) //! # } @@ -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\"]; |