From c43ad9bfb9467627df1b40266ac7b0d570a55a62 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 21 Jul 2022 15:44:49 +0200 Subject: Refactor to move `index` field to `point` --- src/util/span.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/util/span.rs') 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, }; } -- cgit