diff options
Diffstat (limited to '')
-rw-r--r-- | src/construct/hard_break_escape.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/construct/hard_break_escape.rs b/src/construct/hard_break_escape.rs index 19d430d..617b0ce 100644 --- a/src/construct/hard_break_escape.rs +++ b/src/construct/hard_break_escape.rs @@ -41,7 +41,7 @@ //! [html]: https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-br-element use crate::token::Token; -use crate::tokenizer::{Code, State, StateFnResult, Tokenizer}; +use crate::tokenizer::{Code, State, Tokenizer}; /// Start of a hard break (escape). /// @@ -50,16 +50,16 @@ use crate::tokenizer::{Code, State, StateFnResult, Tokenizer}; /// ^ /// | b /// ``` -pub fn start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +pub fn start(tokenizer: &mut Tokenizer, code: Code) -> State { match code { Code::Char('\\') if tokenizer.parse_state.constructs.hard_break_escape => { tokenizer.enter(Token::HardBreakEscape); tokenizer.enter(Token::HardBreakEscapeMarker); tokenizer.consume(code); tokenizer.exit(Token::HardBreakEscapeMarker); - (State::Fn(Box::new(inside)), 0) + State::Fn(Box::new(inside)) } - _ => (State::Nok, 0), + _ => State::Nok, } } @@ -70,12 +70,12 @@ pub fn start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { /// ^ /// | b /// ``` -fn inside(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { +fn inside(tokenizer: &mut Tokenizer, code: Code) -> State { match code { Code::CarriageReturnLineFeed | Code::Char('\n' | '\r') => { tokenizer.exit(Token::HardBreakEscape); - (State::Ok, if matches!(code, Code::None) { 0 } else { 1 }) + State::Ok(if matches!(code, Code::None) { 0 } else { 1 }) } - _ => (State::Nok, 0), + _ => State::Nok, } } |