summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/roadmap.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/roadmap.rs b/src/roadmap.rs
index 7924874..8f2fb9d 100644
--- a/src/roadmap.rs
+++ b/src/roadmap.rs
@@ -31,12 +31,7 @@ impl Roadmap {
/// Get a step, given its name.
pub fn get_step<'a>(&'a self, name: &str) -> Option<&'a Step> {
- for step in self.steps.iter() {
- if step.name() == name {
- return Some(step);
- }
- }
- None
+ self.steps.iter().filter(|step| step.name() == name).next()
}
/// Add a step to the roadmap. This may fail, if there's a step