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].
The signature of this method is currently:
I am wondering if there is any harm in adding
?Sized
to the type parameterK
, as follows:I have a type for which I have implemented
std::ops::RangeBounds<[u8]>
, however I can't use it as a parameter to therange
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]
.