From 5e34e8c7ff530201a140afb8bc170e0461762b69 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 4 Oct 2019 10:05:38 +0300 Subject: Refactor: simplify logic in is_goal --- src/map.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/map.rs b/src/map.rs index 979abdb..994633b 100644 --- a/src/map.rs +++ b/src/map.rs @@ -113,8 +113,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 { - let has_parent = self.steps.iter().any(|other| other.depends_on(step.name())); - !has_parent + self.steps.iter().all(|other| !other.depends_on(step.name())) } /// Get a Graphviz dot language representation of a roadmap. This -- cgit v1.2.1