You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running into an odd issue with subseq when using it to get a subsequence of Spans. If the passed interval is smaller than the total length of the spans, then it's missing all the zero length spans.
I hope the following test clarifies what I am trying to describe here:
#[test]fnsubseq_sub_interval(){letmut sb = SpansBuilder::new(18);
sb.add_span(9..9,0);
sb.add_span(11..12,0);let spans = sb.build();assert_eq!(spans.iter().count(), 2);assert_eq!(spans.subseq(0..18).iter().count(), 2);// all good hereassert_eq!(spans.subseq(0..17).iter().count(), 2);// ERROR: the 9..9 interval is missing, but the 11..12 interval is there}
I think this is a bug?
The text was updated successfully, but these errors were encountered:
Hmm, this is interesting. I think there actually was a design decision to not include zero-length spans, because they were meaningless in the context of the original use of this data structure (syntax highlighting) and are arguably meaningless in the context of an interval tree. Maybe @raphlinus has some thoughts here? the design for annotations does rely on being able to represent annotations that are associated with zero-length spans (such as a deletion in version control) so there's a clear case.
I'm running into an odd issue with
subseq
when using it to get a subsequence ofSpans
. If the passed interval is smaller than the total length of the spans, then it's missing all the zero length spans.I hope the following test clarifies what I am trying to describe here:
I think this is a bug?
The text was updated successfully, but these errors were encountered: