Can `K` in `Tree::Range` be made `?Sized`?
Opened this issue · 0 comments
Rafferty97 commented
The signature of this method is currently:
pub fn range<K, R>(&self, range: R) -> Iter
where
K: AsRef<[u8]>,
R: RangeBounds<K>;
I am wondering if there is any harm in adding ?Sized
to the type parameter K
, as follows:
pub fn range<K, R>(&self, range: R) -> Iter
where
K: AsRef<[u8]> + ?Sized,
R: RangeBounds<K>;
I have a type for which I have implemented std::ops::RangeBounds<[u8]>
, however I can't use it as a parameter to the range
method due to [u8]
being an unsized type, even though that shouldn't be an issue as it's only ever used in its borrowed form &[u8]
.