aboutsummaryrefslogtreecommitdiffstats
path: root/src/tokenizer.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-21 16:06:50 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-21 16:06:50 +0200
commitc6f92eaedf197beafef461ee6c2bd067e7160c49 (patch)
treec919113a51065c5d8126991cde1edf7fd6609e8b /src/tokenizer.rs
parentbcc4676b84a06af5e38ebaa31f0217cae090be08 (diff)
downloadmarkdown-rs-c6f92eaedf197beafef461ee6c2bd067e7160c49.tar.gz
markdown-rs-c6f92eaedf197beafef461ee6c2bd067e7160c49.tar.bz2
markdown-rs-c6f92eaedf197beafef461ee6c2bd067e7160c49.zip
Refactor to improve a bunch of states
* Improve passing stuff around * Add traits to enums for markers and such * Fix “life time” stuff I didn’t understand
Diffstat (limited to 'src/tokenizer.rs')
-rw-r--r--src/tokenizer.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tokenizer.rs b/src/tokenizer.rs
index 909a1d1..8e9c7c6 100644
--- a/src/tokenizer.rs
+++ b/src/tokenizer.rs
@@ -142,6 +142,7 @@ pub struct Event {
/// It’s responsible for dealing with that single passed [`Code`][].
/// It yields a [`StateFnResult`][].
pub type StateFn = dyn FnOnce(&mut Tokenizer, Code) -> StateFnResult;
+
/// Each [`StateFn`][] yields something back: primarily the state.
/// In certain cases, it can also yield back up parsed codes that were passed down.
pub type StateFnResult = (State, Option<Vec<Code>>);