From cdf9f97c34734e82431bbc54d3383f7ac6ac328e Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 13 Oct 2022 19:03:03 +0200 Subject: Remove some unused code --- src/construct/label_end.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/construct/label_end.rs') diff --git a/src/construct/label_end.rs b/src/construct/label_end.rs index ca71245..d48f0c5 100644 --- a/src/construct/label_end.rs +++ b/src/construct/label_end.rs @@ -624,16 +624,13 @@ pub fn reference_full_after(tokenizer: &mut Tokenizer) -> State { /// ^ /// ``` pub fn reference_collapsed(tokenizer: &mut Tokenizer) -> State { - match tokenizer.current { - Some(b'[') => { - tokenizer.enter(Name::Reference); - tokenizer.enter(Name::ReferenceMarker); - tokenizer.consume(); - tokenizer.exit(Name::ReferenceMarker); - State::Next(StateName::LabelEndReferenceCollapsedOpen) - } - _ => State::Nok, - } + // We only attempt a collapsed label if there’s a `[`. + debug_assert_eq!(tokenizer.current, Some(b'['), "expected opening bracket"); + tokenizer.enter(Name::Reference); + tokenizer.enter(Name::ReferenceMarker); + tokenizer.consume(); + tokenizer.exit(Name::ReferenceMarker); + State::Next(StateName::LabelEndReferenceCollapsedOpen) } /// In reference (collapsed), at `]`. -- cgit