diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-07-19 17:56:57 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-07-19 17:56:57 +0200 |
commit | 0f20660cb95abd4f407bdafa2c45e01829fa971f (patch) | |
tree | 865875c20cee2e74f95e54f52aa73105e90067e7 /src/subtokenize.rs | |
parent | ae0f12e668cfd37728aad907c813431595e6cc1b (diff) | |
download | markdown-rs-0f20660cb95abd4f407bdafa2c45e01829fa971f.tar.gz markdown-rs-0f20660cb95abd4f407bdafa2c45e01829fa971f.tar.bz2 markdown-rs-0f20660cb95abd4f407bdafa2c45e01829fa971f.zip |
Refactor to remove cloning in `edit_map`
Diffstat (limited to 'src/subtokenize.rs')
-rw-r--r-- | src/subtokenize.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/subtokenize.rs b/src/subtokenize.rs index 174ddfe..df7b015 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(mut events: Vec<Event>, parse_state: &ParseState) -> (Vec<Event>, bool) { +pub fn subtokenize(events: Vec<Event>, parse_state: &ParseState) -> (Vec<Event>, bool) { let mut edit_map = EditMap::new(); let mut done = true; let mut index = 0; @@ -178,5 +178,5 @@ pub fn subtokenize(mut events: Vec<Event>, parse_state: &ParseState) -> (Vec<Eve index += 1; } - (edit_map.consume(&mut events), done) + (edit_map.consume(events), done) } |