summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-10-04 11:13:21 +0300
committerLars Wirzenius <liw@liw.fi>2019-10-04 11:13:21 +0300
commitc234660420250c03f514791e854c59e6e8432410 (patch)
tree54140c8361393749f20badfde26475aa1e2647fe
parentb1574e3bcc1135ba513521ed76796a31895afc34 (diff)
downloadroadmap-c234660420250c03f514791e854c59e6e8432410.tar.gz
Change: rustfmt
-rw-r--r--src/map.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/map.rs b/src/map.rs
index 0184fc1..1f693ac 100644
--- a/src/map.rs
+++ b/src/map.rs
@@ -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?