diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-06-21 16:06:50 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-06-21 16:06:50 +0200 |
commit | c6f92eaedf197beafef461ee6c2bd067e7160c49 (patch) | |
tree | c919113a51065c5d8126991cde1edf7fd6609e8b /src/tokenizer.rs | |
parent | bcc4676b84a06af5e38ebaa31f0217cae090be08 (diff) | |
download | markdown-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.rs | 1 |
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>>); |