From c6f92eaedf197beafef461ee6c2bd067e7160c49 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Tue, 21 Jun 2022 16:06:50 +0200 Subject: Refactor to improve a bunch of states MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Improve passing stuff around * Add traits to enums for markers and such * Fix “life time” stuff I didn’t understand --- src/tokenizer.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/tokenizer.rs') 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>); -- cgit