aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/util.rs b/src/util.rs
index 47359a3..5a916cd 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -165,12 +165,12 @@ pub fn get_span(events: &[Event], index: usize) -> Span {
assert_eq!(
exit.event_type,
EventType::Exit,
- "expected get_span to be called on `exit` event"
+ "expected `get_span` to be called on `exit` event"
);
- let mut start_index = index - 1;
+ let mut enter_index = index - 1;
loop {
- let enter = &events[start_index];
+ let enter = &events[enter_index];
if enter.event_type == EventType::Enter && enter.token_type == token_type {
return Span {
// start: enter.point.clone(),
@@ -181,7 +181,7 @@ pub fn get_span(events: &[Event], index: usize) -> Span {
};
}
- start_index -= 1;
+ enter_index -= 1;
}
}