From 8e4095e17b087cdab0d568f21e6717d0b5f3dab7 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 4 Oct 2019 10:08:58 +0300 Subject: Change: rename as_dot to format_as_dot --- src/bin/roadmap2dot.rs | 2 +- src/lib.rs | 2 +- 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> { 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> { + pub fn format_as_dot(&self, label_width: usize) -> Result> { 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\"]; -- cgit v1.2.1