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/list.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/construct/list.rs') diff --git a/src/construct/list.rs b/src/construct/list.rs index db8af36..48ed291 100644 --- a/src/construct/list.rs +++ b/src/construct/list.rs @@ -50,7 +50,7 @@ use crate::construct::{ thematic_break::start as thematic_break, }; 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, @@ -390,7 +390,7 @@ fn nok(_tokenizer: &mut Tokenizer, _code: Code) -> StateFnResult { } /// Find adjacent list items with the same marker. -pub fn resolve_list_item(tokenizer: &mut Tokenizer) -> Vec { +pub fn resolve_list_item(tokenizer: &mut Tokenizer) { let mut edit_map = EditMap::new(); let mut index = 0; let mut balance = 0; @@ -492,5 +492,5 @@ pub fn resolve_list_item(tokenizer: &mut Tokenizer) -> Vec { index += 1; } - edit_map.consume(tokenizer.events.split_off(0)) + edit_map.consume(&mut tokenizer.events); } -- cgit