From b945e43103544fc31a0755841b380358b2c161e6 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Fri, 22 Jul 2022 17:16:38 +0200 Subject: Refactor to remove unneeded tuples in every states --- src/content/text.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/content/text.rs') diff --git a/src/content/text.rs b/src/content/text.rs index c339324..0d90cb4 100644 --- a/src/content/text.rs +++ b/src/content/text.rs @@ -27,7 +27,7 @@ use crate::construct::{ label_start_link::start as label_start_link, partial_data::start as data, partial_whitespace::whitespace, }; -use crate::tokenizer::{Code, State, StateFnResult, Tokenizer}; +use crate::tokenizer::{Code, State, Tokenizer}; const MARKERS: [Code; 12] = [ Code::VirtualSpace, // `whitespace` @@ -45,9 +45,9 @@ const MARKERS: [Code; 12] = [ ]; /// Before text. -pub fn start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +pub fn start(tokenizer: &mut Tokenizer, code: Code) -> State { match code { - Code::None => (State::Ok, 0), + Code::None => State::Ok(0), _ => tokenizer.attempt_n( vec![ Box::new(attention), @@ -76,6 +76,6 @@ pub fn start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { /// ```markdown /// |qwe /// ``` -fn before_data(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn before_data(tokenizer: &mut Tokenizer, code: Code) -> State { tokenizer.go(|t, c| data(t, c, &MARKERS), start)(tokenizer, code) } -- cgit