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/label_start_image.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/construct/label_start_image.rs') diff --git a/src/construct/label_start_image.rs b/src/construct/label_start_image.rs index ce09f5b..b2890e6 100644 --- a/src/construct/label_start_image.rs +++ b/src/construct/label_start_image.rs @@ -40,15 +40,14 @@ use crate::tokenizer::{LabelStart, Tokenizer}; /// ^ /// ``` pub fn start(tokenizer: &mut Tokenizer) -> State { - match tokenizer.current { - Some(b'!') if tokenizer.parse_state.constructs.label_start_image => { - tokenizer.enter(Name::LabelImage); - tokenizer.enter(Name::LabelImageMarker); - tokenizer.consume(); - tokenizer.exit(Name::LabelImageMarker); - State::Next(StateName::LabelStartImageOpen) - } - _ => State::Nok, + if tokenizer.parse_state.constructs.label_start_image && tokenizer.current == Some(b'!') { + tokenizer.enter(Name::LabelImage); + tokenizer.enter(Name::LabelImageMarker); + tokenizer.consume(); + tokenizer.exit(Name::LabelImageMarker); + State::Next(StateName::LabelStartImageOpen) + } else { + State::Nok } } -- cgit