Closed SatoKentaNayoro closed 1 year ago
This should work
struct RangeInclusiveArray<const N: usize>([u8; N], [u8; N]);
impl<const N: usize> RangeBounds<[u8]> for RangeInclusiveArray<N> {
fn start_bound(&self) -> std::ops::Bound<&[u8]> {
std::ops::Bound::Included(&self.0)
}
fn end_bound(&self) -> std::ops::Bound<&[u8]> {
std::ops::Bound::Included(&self.1)
}
}
Hey @hxuchen 👋
Is your last post exposing the solution to your problem? Have you found how to do it?
@Kerollmops 👋
Yes, I built this struct struct RangeInclusiveArray<const N: usize>([u8; N], [u8; N]);
, and then implemented the RangeBounds<[u8]>
trait for it. It resolved my issue and passed the tests.
While attempting to transition the database used in the ord to
lmdb
. I encountered confusion when using therange
operation. When I tried using&([u8; 44][..]..=[u8; 44[..]])
: failed deom1, I received the error messagethe size for values of type [u8] cannot be known at compilation time
. Similarly, when I utilized&(&[u8; 44]..=&[u8; 44])
: failed demo2, I encountered the error messagethe trait bound RangeInclusive<&[u8; 44]>: RangeBounds<[u8]> is not satisfied
. Eventually, I managed to complete the testing usingiter demo
. How should I modify my code to address these issues?