summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--subplotlib/src/step.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/subplotlib/src/step.rs b/subplotlib/src/step.rs
index bbea249..7a70e23 100644
--- a/subplotlib/src/step.rs
+++ b/subplotlib/src/step.rs
@@ -10,6 +10,8 @@ use std::panic::{catch_unwind, AssertUnwindSafe};
use crate::scenario::{Scenario, ScenarioContext};
use crate::types::StepResult;
+type StepFunc = dyn Fn(&ScenarioContext, bool) -> StepResult;
+
/// A ScenarioStep is one step in a scenario.
///
/// In essence, a scenario step is a named closure. Its name can be used when
@@ -28,7 +30,7 @@ use crate::types::StepResult;
/// ```
pub struct ScenarioStep {
step_text: String,
- func: Box<dyn Fn(&ScenarioContext, bool) -> StepResult>,
+ func: Box<StepFunc>,
reg: Box<dyn Fn(&Scenario)>,
}