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/steps.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/steps.rs')
-rw-r--r-- | src/steps.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/steps.rs b/src/steps.rs index c8c1bf6..ccbc588 100644 --- a/src/steps.rs +++ b/src/steps.rs @@ -1,4 +1,4 @@ -use crate::{Result, SubplotError}; +use crate::SubplotError; use serde::{Deserialize, Serialize}; use std::fmt; @@ -47,7 +47,10 @@ impl ScenarioStep { /// /// If the step uses the "and" or "but" keyword, use the default /// step kind instead. - pub fn new_from_str(text: &str, default: Option<StepKind>) -> Result<ScenarioStep> { + pub fn new_from_str( + text: &str, + default: Option<StepKind>, + ) -> Result<ScenarioStep, SubplotError> { let mut words = text.split_whitespace(); let keyword = match words.next() { |