aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/partial_data.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-20 12:34:06 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-20 12:34:06 +0200
commit7894ec75a7070591c3499fce1f409563c4edc7d7 (patch)
tree170d736268a30b728f28b164213a0a0ac47414da /src/construct/partial_data.rs
parent7ec35068c86a546dac8172e74e8a34e3b6813eb2 (diff)
downloadmarkdown-rs-7894ec75a7070591c3499fce1f409563c4edc7d7.tar.gz
markdown-rs-7894ec75a7070591c3499fce1f409563c4edc7d7.tar.bz2
markdown-rs-7894ec75a7070591c3499fce1f409563c4edc7d7.zip
Refactor to use less vecs for events
Diffstat (limited to 'src/construct/partial_data.rs')
-rw-r--r--src/construct/partial_data.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/construct/partial_data.rs b/src/construct/partial_data.rs
index b59bb76..b56efd2 100644
--- a/src/construct/partial_data.rs
+++ b/src/construct/partial_data.rs
@@ -7,7 +7,7 @@
//! [text]: crate::content::text
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;
/// At the beginning of data.
@@ -75,7 +75,7 @@ fn data(tokenizer: &mut Tokenizer, code: Code, stop: Vec<Code>) -> StateFnResult
}
/// Merge adjacent data events.
-pub fn resolve_data(tokenizer: &mut Tokenizer) -> Vec<Event> {
+pub fn resolve_data(tokenizer: &mut Tokenizer) {
let mut edit_map = EditMap::new();
let len = tokenizer.events.len();
let mut index = 0;
@@ -114,5 +114,5 @@ pub fn resolve_data(tokenizer: &mut Tokenizer) -> Vec<Event> {
index += 1;
}
- edit_map.consume(tokenizer.events.split_off(0))
+ edit_map.consume(&mut tokenizer.events);
}