summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-10-04 10:46:03 +0300
committerLars Wirzenius <liw@liw.fi>2019-10-04 10:46:03 +0300
commitd4177cf1bae2bb078cae536016a9ade5d7c95357 (patch)
tree9c34de37c939362ba2e2bdda2c439393c510bcf0
parentc04ab5b326bbe41a7760ffd893174b046816dfc9 (diff)
downloadroadmap-d4177cf1bae2bb078cae536016a9ade5d7c95357.tar.gz
Change: dedends_on to get other step, not its name, as paramter
-rw-r--r--src/map.rs2
-rw-r--r--src/step.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/map.rs b/src/map.rs
index ab27164..0184fc1 100644
--- a/src/map.rs
+++ b/src/map.rs
@@ -118,7 +118,7 @@ impl Roadmap {
/// Should status be goal? In other words, does any other step
/// depend on this one?
pub fn is_goal(&self, step: &Step) -> bool {
- self.steps.iter().all(|other| !other.depends_on(step.name()))
+ self.steps.iter().all(|other| !other.depends_on(&step))
}
diff --git a/src/step.rs b/src/step.rs
index 4012da7..221b2bd 100644
--- a/src/step.rs
+++ b/src/step.rs
@@ -57,8 +57,8 @@ impl Step {
}
/// Does this step depend on given other step?
- pub fn depends_on(&self, other_name: &str) -> bool {
- self.depends.iter().any(|depname| depname == other_name)
+ pub fn depends_on(&self, other: &Step) -> bool {
+ self.depends.iter().any(|depname| depname == other.name())
}
}