diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-07-20 18:00:52 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-07-20 18:00:52 +0200 |
commit | 75c2109c6051009b220436bd823970a374f4f9fd (patch) | |
tree | c8123e6e4a0a71e2daec77d76c0dc4485bad2240 /src/subtokenize.rs | |
parent | 86801cdb3b114b30a14d4b8c01c8fb70b2bcee82 (diff) | |
download | markdown-rs-75c2109c6051009b220436bd823970a374f4f9fd.tar.gz markdown-rs-75c2109c6051009b220436bd823970a374f4f9fd.tar.bz2 markdown-rs-75c2109c6051009b220436bd823970a374f4f9fd.zip |
Refactor to share edit map
Diffstat (limited to 'src/subtokenize.rs')
-rw-r--r-- | src/subtokenize.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/subtokenize.rs b/src/subtokenize.rs index 7b7d6bd..272978d 100644 --- a/src/subtokenize.rs +++ b/src/subtokenize.rs @@ -62,7 +62,7 @@ pub fn link_to(events: &mut [Event], pevious: usize, next: usize) { /// /// Supposed to be called repeatedly, returns `1: true` when done. pub fn subtokenize(events: &mut Vec<Event>, parse_state: &ParseState) -> bool { - let mut edit_map = EditMap::new(); + let mut map = EditMap::new(); let mut done = true; let mut index = 0; @@ -166,7 +166,7 @@ pub fn subtokenize(events: &mut Vec<Event>, parse_state: &ParseState) -> bool { while index > 0 { index -= 1; - edit_map.add( + map.add( slices[index].0, 2, tokenizer.events.split_off(slices[index].1), @@ -178,7 +178,7 @@ pub fn subtokenize(events: &mut Vec<Event>, parse_state: &ParseState) -> bool { index += 1; } - edit_map.consume(events); + map.consume(events); done } |