diff options
author | Daniel Silverstone <dsilvers+gitlab@digital-scurf.org> | 2022-05-06 19:28:34 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers+gitlab@digital-scurf.org> | 2022-05-06 19:28:34 +0000 |
commit | 27b617cbaa9e6d4fb58a0b971b428a05da8ec5d9 (patch) | |
tree | 08067bf4290982e4a717ba55a660714084370158 /src/matches.rs | |
parent | c2cbccd45a2c356e458abc8bbef3193434e8572a (diff) | |
parent | 52ccfa5a1bf2893bdc63ff1bad2b2a88ca86ef95 (diff) | |
download | subplot-27b617cbaa9e6d4fb58a0b971b428a05da8ec5d9.tar.gz |
Merge branch 'liw/tidy-up-error' into 'main'
tidy up error handling a bit
See merge request subplot/subplot!275
Diffstat (limited to 'src/matches.rs')
-rw-r--r-- | src/matches.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/matches.rs b/src/matches.rs index f8e527a..9130641 100644 --- a/src/matches.rs +++ b/src/matches.rs @@ -1,7 +1,7 @@ use crate::Binding; -use crate::Result; use crate::Scenario; use crate::StepKind; +use crate::SubplotError; use crate::{bindings::CaptureType, Bindings}; use std::collections::HashMap; @@ -17,8 +17,12 @@ pub struct MatchedScenario { impl MatchedScenario { /// Construct a new matched scenario - pub fn new(template: &str, scen: &Scenario, bindings: &Bindings) -> Result<MatchedScenario> { - let steps: Result<Vec<MatchedStep>> = scen + pub fn new( + template: &str, + scen: &Scenario, + bindings: &Bindings, + ) -> Result<MatchedScenario, SubplotError> { + let steps: Result<Vec<MatchedStep>, SubplotError> = scen .steps() .iter() .map(|step| bindings.find(template, step)) |