diff options
author | Lars Wirzenius <liw@liw.fi> | 2019-12-14 16:17:06 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2019-12-14 16:17:06 +0200 |
commit | 9337e6a1c1d4cce73791b2147cdfd7a0fd27240c (patch) | |
tree | 66f00b0cbfb0a2e346769419b6652699fe5b106d /src/steps.rs | |
parent | 821746369bd0a4afc4b8ab8f5cec0ed4504dbe54 (diff) | |
download | subplot-9337e6a1c1d4cce73791b2147cdfd7a0fd27240c.tar.gz |
Change: fix or add doc comments everywhere
Diffstat (limited to 'src/steps.rs')
-rw-r--r-- | src/steps.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/steps.rs b/src/steps.rs index ce1c031..86ca0a9 100644 --- a/src/steps.rs +++ b/src/steps.rs @@ -1,11 +1,13 @@ -/// A parsed scenario step. +#[deny(missing_docs)] +/// A scenario step. /// /// The scenario parser creates these kinds of data structures to -/// represent the parsed scenario step. The step consits of a kind +/// represent the parsed scenario step. The step consists of a kind /// (expressed as a StepKind), and the text of the step. /// /// This is just the step as it appears in the scenario in the input -/// text. It has not been matched with a binding. See Match for that. +/// text. It has not been matched with a binding. See MatchedStep for +/// that. #[derive(Debug, Eq, PartialEq)] pub struct ScenarioStep { kind: StepKind, @@ -13,6 +15,7 @@ pub struct ScenarioStep { } impl ScenarioStep { + /// Construct a new step. pub fn new(kind: StepKind, text: &str) -> ScenarioStep { ScenarioStep { kind: kind, @@ -20,14 +23,17 @@ impl ScenarioStep { } } + /// Return the kind of a step. pub fn kind(&self) -> StepKind { self.kind } + /// Return the text of a step. pub fn text(&self) -> &str { &self.text } + /// Construct a step from a line in a scenario. pub fn from_str(text: &str) -> Option<ScenarioStep> { let mut words = text.split_whitespace(); |