summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-11-12 09:04:53 +0200
committerLars Wirzenius <liw@liw.fi>2022-11-12 09:04:53 +0200
commitdf592184242b5c301dbad1a7dce5810e803fce33 (patch)
tree4c6642ac39e3b745cbbef0aa559979ccd403c745
parentd1c2cd39f5a9a1fcfbf6b96af3ab18cc65518462 (diff)
downloadsubplot-df592184242b5c301dbad1a7dce5810e803fce33.tar.gz
chore: use type alias to make code slightly more easier to follow
Found by clippy. Sponsored-by: author
-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)>,
}