diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-07-21 15:32:48 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-07-21 15:32:53 +0200 |
commit | 2d0dfe66d423e707b7de60d9bde0cec7933580fe (patch) | |
tree | ddbe9729046c740b07e656920fa991c475983046 /src/util | |
parent | 75c2109c6051009b220436bd823970a374f4f9fd (diff) | |
download | markdown-rs-2d0dfe66d423e707b7de60d9bde0cec7933580fe.tar.gz markdown-rs-2d0dfe66d423e707b7de60d9bde0cec7933580fe.tar.bz2 markdown-rs-2d0dfe66d423e707b7de60d9bde0cec7933580fe.zip |
Refactor to move some event fields to `link`
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/edit_map.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/util/edit_map.rs b/src/util/edit_map.rs index b1b5064..6085f18 100644 --- a/src/util/edit_map.rs +++ b/src/util/edit_map.rs @@ -35,9 +35,11 @@ fn shift_links(events: &mut [Event], jumps: &[(usize, usize, usize)]) { let mut index = 0; while index < events.len() { - let event = &mut events[index]; - event.previous = event.previous.map(map); - event.next = event.next.map(map); + if let Some(link) = &mut events[index].link { + link.previous = link.previous.map(map); + link.next = link.next.map(map); + } + index += 1; } } |