diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-05-05 19:28:57 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-05-05 19:28:57 +0300 |
commit | 6498b2eecb21ad87069be8f501f35374745106d9 (patch) | |
tree | 18af0fcdb186609452825adb3155badcd4aaa013 /src/matches.rs | |
parent | 12059fcb1ce8237e5587773043cd442e036531c2 (diff) | |
download | subplot-6498b2eecb21ad87069be8f501f35374745106d9.tar.gz |
refactor: drop the subplot::Result type alias
Replace subplot::Result<T> with Result<T, SubplotError>. I find this
now to be clearer, as I don't need to remind myself which Result is
being used where. This should not be a breaking change.
Sponsored-by: author
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)) |