diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-08-12 17:02:01 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-08-12 17:02:01 +0200 |
commit | 6ba11bdaca1721fb4591819604c340d147798f45 (patch) | |
tree | ef602b518043c0a7228e76d9d00bee95a17798d4 /src/construct/hard_break_escape.rs | |
parent | 504729a4a0c8f3e0d8fc9159e0273150b169e184 (diff) | |
download | markdown-rs-6ba11bdaca1721fb4591819604c340d147798f45.tar.gz markdown-rs-6ba11bdaca1721fb4591819604c340d147798f45.tar.bz2 markdown-rs-6ba11bdaca1721fb4591819604c340d147798f45.zip |
Remove `match` statements if clumsy
Diffstat (limited to '')
-rw-r--r-- | src/construct/hard_break_escape.rs | 13 |
1 files changed, 6 insertions, 7 deletions
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 } } |