From 5ee6edf222658e73ee97871972b6fbeef444451b Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Mon, 25 Jul 2022 17:42:20 +0200 Subject: Refactor to not pass codes around --- src/construct/label_start_link.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/construct/label_start_link.rs') diff --git a/src/construct/label_start_link.rs b/src/construct/label_start_link.rs index f4c2ce8..e13cd77 100644 --- a/src/construct/label_start_link.rs +++ b/src/construct/label_start_link.rs @@ -37,13 +37,13 @@ use crate::tokenizer::{Code, LabelStart, State, Tokenizer}; /// > | a [b] c /// ^ /// ``` -pub fn start(tokenizer: &mut Tokenizer, code: Code) -> State { - match code { +pub fn start(tokenizer: &mut Tokenizer) -> State { + match tokenizer.current { Code::Char('[') if tokenizer.parse_state.constructs.label_start_link => { let start = tokenizer.events.len(); tokenizer.enter(Token::LabelLink); tokenizer.enter(Token::LabelMarker); - tokenizer.consume(code); + tokenizer.consume(); tokenizer.exit(Token::LabelMarker); tokenizer.exit(Token::LabelLink); tokenizer.label_start_stack.push(LabelStart { -- cgit