Closed jimblandy closed 4 days ago
- It is not consistent with Naga's constructor function
Range::new_from_bounds
, which takes an inclusive end value, or withRange::first_and_last
, which returns an inclusive end value. Both of these need to represent ranges' end points asHandle
s, but exclusive end values might not be validHandle
values. I think this divergence is tolerable.
I think the divergence makes sense in this case.
This change looks consistent with the way we index in the Arena
as well.
Change the
std::fmt::Debug
impl fornaga::arena::Range
to print a start-inclusive, end-exclusive range.This is more consistent with Rust's
std::ops::Range
.This is consistent with the serialization form used in snapshots, which simply uses the serialization of
std::ops::Range
.It is not consistent with Naga's constructor function
Range::new_from_bounds
, which takes an inclusive end value, or withRange::first_and_last
, which returns an inclusive end value. Both of these need to represent ranges' end points asHandle
s, but exclusive end values might not be validHandle
values. I think this divergence is tolerable.