aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/span.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-21 15:44:49 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-21 15:44:49 +0200
commitc43ad9bfb9467627df1b40266ac7b0d570a55a62 (patch)
tree27d7b01048a2e161f055388cecaa6bf84e1c01a4 /src/util/span.rs
parent2d0dfe66d423e707b7de60d9bde0cec7933580fe (diff)
downloadmarkdown-rs-c43ad9bfb9467627df1b40266ac7b0d570a55a62.tar.gz
markdown-rs-c43ad9bfb9467627df1b40266ac7b0d570a55a62.tar.bz2
markdown-rs-c43ad9bfb9467627df1b40266ac7b0d570a55a62.zip
Refactor to move `index` field to `point`
Diffstat (limited to '')
-rw-r--r--src/util/span.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/span.rs b/src/util/span.rs
index 72b451d..ca25924 100644
--- a/src/util/span.rs
+++ b/src/util/span.rs
@@ -24,7 +24,7 @@ pub struct Span {
/// When `micromark` is used, this function never panics.
pub fn from_exit_event(events: &[Event], index: usize) -> Span {
let exit = &events[index];
- let end_index = exit.index;
+ let end_index = exit.point.index;
let token_type = exit.token_type.clone();
assert_eq!(
exit.event_type,
@@ -37,7 +37,7 @@ pub fn from_exit_event(events: &[Event], index: usize) -> Span {
let enter = &events[enter_index];
if enter.event_type == EventType::Enter && enter.token_type == token_type {
return Span {
- start_index: enter.index,
+ start_index: enter.point.index,
end_index,
};
}