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/subtokenize.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/subtokenize.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/subtokenize.rs b/src/subtokenize.rs index df7b015..7b7d6bd 100644 --- a/src/subtokenize.rs +++ b/src/subtokenize.rs @@ -61,7 +61,7 @@ pub fn link_to(events: &mut [Event], pevious: usize, next: usize) { /// Parse linked events. /// /// Supposed to be called repeatedly, returns `1: true` when done. -pub fn subtokenize(events: Vec<Event>, parse_state: &ParseState) -> (Vec<Event>, bool) { +pub fn subtokenize(events: &mut Vec<Event>, parse_state: &ParseState) -> bool { let mut edit_map = EditMap::new(); let mut done = true; let mut index = 0; @@ -178,5 +178,7 @@ pub fn subtokenize(events: Vec<Event>, parse_state: &ParseState) -> (Vec<Event>, index += 1; } - (edit_map.consume(events), done) + edit_map.consume(events); + + done } |