diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-07-20 12:34:06 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-07-20 12:34:06 +0200 |
commit | 7894ec75a7070591c3499fce1f409563c4edc7d7 (patch) | |
tree | 170d736268a30b728f28b164213a0a0ac47414da /src/construct/paragraph.rs | |
parent | 7ec35068c86a546dac8172e74e8a34e3b6813eb2 (diff) | |
download | markdown-rs-7894ec75a7070591c3499fce1f409563c4edc7d7.tar.gz markdown-rs-7894ec75a7070591c3499fce1f409563c4edc7d7.tar.bz2 markdown-rs-7894ec75a7070591c3499fce1f409563c4edc7d7.zip |
Refactor to use less vecs for events
Diffstat (limited to '')
-rw-r--r-- | src/construct/paragraph.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/construct/paragraph.rs b/src/construct/paragraph.rs index 53030f4..1b186e3 100644 --- a/src/construct/paragraph.rs +++ b/src/construct/paragraph.rs @@ -33,7 +33,7 @@ //! [html]: https://html.spec.whatwg.org/multipage/grouping-content.html#the-p-element use crate::token::Token; -use crate::tokenizer::{Code, ContentType, Event, EventType, State, StateFnResult, Tokenizer}; +use crate::tokenizer::{Code, ContentType, EventType, State, StateFnResult, Tokenizer}; use crate::util::{edit_map::EditMap, skip::opt as skip_opt}; /// Before a paragraph. @@ -80,7 +80,7 @@ fn inside(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { /// Merge “`Paragraph`”s, which currently span a single line, into actual /// `Paragraph`s that span multiple lines. -pub fn resolve(tokenizer: &mut Tokenizer) -> Vec<Event> { +pub fn resolve(tokenizer: &mut Tokenizer) { let mut edit_map = EditMap::new(); let len = tokenizer.events.len(); let mut index = 0; @@ -142,5 +142,5 @@ pub fn resolve(tokenizer: &mut Tokenizer) -> Vec<Event> { index += 1; } - edit_map.consume(tokenizer.events.split_off(0)) + edit_map.consume(&mut tokenizer.events); } |