From 7894ec75a7070591c3499fce1f409563c4edc7d7 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Wed, 20 Jul 2022 12:34:06 +0200 Subject: Refactor to use less vecs for events --- src/construct/heading_setext.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/construct/heading_setext.rs') diff --git a/src/construct/heading_setext.rs b/src/construct/heading_setext.rs index 841bf53..d1e7d57 100644 --- a/src/construct/heading_setext.rs +++ b/src/construct/heading_setext.rs @@ -60,7 +60,7 @@ use crate::constant::TAB_SIZE; use crate::construct::partial_space_or_tab::{space_or_tab, space_or_tab_min_max}; use crate::token::Token; -use crate::tokenizer::{Code, Event, EventType, State, StateFnResult, Tokenizer}; +use crate::tokenizer::{Code, EventType, State, StateFnResult, Tokenizer}; use crate::util::{edit_map::EditMap, skip::opt_back as skip_opt_back}; /// Kind of underline. @@ -196,7 +196,7 @@ fn after(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { } /// Resolve heading (setext). -pub fn resolve(tokenizer: &mut Tokenizer) -> Vec { +pub fn resolve(tokenizer: &mut Tokenizer) { let mut edit_map = EditMap::new(); let mut index = 0; let mut paragraph_enter: Option = None; @@ -236,5 +236,5 @@ pub fn resolve(tokenizer: &mut Tokenizer) -> Vec { index += 1; } - edit_map.consume(tokenizer.events.split_off(0)) + edit_map.consume(&mut tokenizer.events); } -- cgit