diff options
author | Lars Wirzenius <liw@liw.fi> | 2019-09-22 21:26:25 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2019-09-22 21:26:25 +0300 |
commit | 2e87edb1382f8e00f52b0ca3e11c3aff39c57a7f (patch) | |
tree | 68aa3436fd38ee9fc8616a0d32e668aee0f79ad2 /src/lib.rs | |
parent | 90cda0b35339a525d91ac7fcd16bd180f9bf6045 (diff) | |
download | roadmap-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/lib.rs')
-rw-r--r-- | src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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: |