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
error[E0277]: the trait bound `Element<_, _>: From<(RangeInclusive<usize>, SirLabel)>` is not satisfied
--> yktrace/src/hwt/mapper.rs:91:5
|
91 | IntervalTree::from_iter(vec.into_iter().map(|l| (l.off..=l.off, l)))
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<(RangeInclusive<usize>, SirLabel)>` is not implemented for `Element<_, _>`
|
::: /home/vext01/research/yorick/ykrustc/library/core/src/iter/traits/collect.rs:113:34
|
113 | fn from_iter<T: IntoIterator<Item = A>>(iter: T) -> Self;
| -------- required by this bound in `from_iter`
|
= help: the following implementations were found:
<Element<K, V> as From<(std::ops::Range<K>, V)>>
= note: required because of the requirements on the impl of `Into<Element<_, _>>` for `(RangeInclusive<usize>, SirLabel)`
= note: required because of the requirements on the impl of `FromIterator<(RangeInclusive<usize>, SirLabel)>` for `IntervalTree<_, _>`
The text was updated successfully, but these errors were encountered:
Yes. The query function directly takes a Range and so does not accept RangeInclusive unfortunately. The reason is that the RangeBounds trait was not stable back when I wrote this library. The solution would be to make querying generic over objects implementing this trait. Then it could also work with all kinds of ranges, e.g. half-open ranges etc.
I think #12 could be a useful first step in this direction.
Personally, since I use this to index closed intervals as well, I currently help myself by just doing end: end + 1 during construction which should work if you internal boundaries have an integral type.
Hi,
Neat library. Thanks for writing it!
Seems that you can't use
RangeInclusive
intervals with the intervaltree API?Example error messages:
The text was updated successfully, but these errors were encountered: