From 6ba11bdaca1721fb4591819604c340d147798f45 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Fri, 12 Aug 2022 17:02:01 +0200 Subject: Remove `match` statements if clumsy --- src/construct/hard_break_escape.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/construct/hard_break_escape.rs') diff --git a/src/construct/hard_break_escape.rs b/src/construct/hard_break_escape.rs index cec34d5..79d8150 100644 --- a/src/construct/hard_break_escape.rs +++ b/src/construct/hard_break_escape.rs @@ -51,13 +51,12 @@ use crate::tokenizer::Tokenizer; /// | b /// ``` pub fn start(tokenizer: &mut Tokenizer) -> State { - match tokenizer.current { - Some(b'\\') if tokenizer.parse_state.constructs.hard_break_escape => { - tokenizer.enter(Name::HardBreakEscape); - tokenizer.consume(); - State::Next(StateName::HardBreakEscapeAfter) - } - _ => State::Nok, + if tokenizer.parse_state.constructs.hard_break_escape && tokenizer.current == Some(b'\\') { + tokenizer.enter(Name::HardBreakEscape); + tokenizer.consume(); + State::Next(StateName::HardBreakEscapeAfter) + } else { + State::Nok } } -- cgit