summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-09-22 21:26:25 +0300
committerLars Wirzenius <liw@liw.fi>2019-09-22 21:26:25 +0300
commit2e87edb1382f8e00f52b0ca3e11c3aff39c57a7f (patch)
tree68aa3436fd38ee9fc8616a0d32e668aee0f79ad2 /src
parent90cda0b35339a525d91ac7fcd16bd180f9bf6045 (diff)
downloadroadmap-2e87edb1382f8e00f52b0ca3e11c3aff39c57a7f.tar.gz
Change: don't require mutable roadmap for get_step
In a previous version of the code, we got a step, theh modified it, but no longer. Better this way.
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index a5422ab..4b146f2 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -130,8 +130,8 @@ impl Roadmap {
}
/// Get a step, given its name.
- pub fn get_step<'a>(&'a mut self, name: &str) -> Option<&'a mut Step> {
- for step in self.steps.iter_mut() {
+ 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);
}
@@ -261,7 +261,7 @@ first -> second;
#[test]
fn from_nonempty_yaml() {
- let mut roadmap = Roadmap::from_yaml("
+ let roadmap = Roadmap::from_yaml("
first:
label: the first step
second: