diff options
Diffstat (limited to 'src/map.rs')
-rw-r--r-- | src/map.rs | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -4,16 +4,14 @@ pub use crate::from_yaml; pub use crate::Status; pub use crate::Step; - /// Error in Roadmap, from parsing or otherwise. pub type RoadmapError<T> = Result<T, String>; - /// Represent a full project roadmap. /// /// This stores all the steps needed to reach the end goal. See the /// crate leve documentation for an example. -#[derive(Clone,Debug)] +#[derive(Clone, Debug)] pub struct Roadmap { steps: Vec<Step>, } @@ -28,14 +26,11 @@ impl Roadmap { /// Count number of steps that nothing depends on. pub fn count_goals(&self) -> usize { - self.steps - .iter() - .filter(|step| self.is_goal(step)) - .count() + self.steps.iter().filter(|step| self.is_goal(step)).count() } /// Iterate over step names. - pub fn step_names(&self) -> impl Iterator<Item=&str> { + pub fn step_names(&self) -> impl Iterator<Item = &str> { self.steps.iter().map(|step| step.name()) } @@ -121,7 +116,6 @@ impl Roadmap { self.steps.iter().all(|other| !other.depends_on(&step)) } - // Validate that the parsed, constructed roadmap is valid. pub fn validate(&self) -> RoadmapError<()> { // Is there exactly one goal? |