[naga] Use Range::from_index_range in Arena::range_from.

Use the associated function `Range::from_index_range` to construct the
return value of `Arena::range_from`, rather than constructing the
`Range` directly, in preparation for those fields becoming private.
This commit is contained in:
Jim Blandy
2024-06-22 18:11:55 -07:00
parent a7d4d2c79f
commit 3e20909ade

View File

@@ -378,10 +378,8 @@ impl<T> Arena<T> {
/// Get the range of handles from a particular number of elements to the end.
pub fn range_from(&self, old_length: usize) -> Range<T> {
Range {
inner: old_length as u32..self.data.len() as u32,
marker: PhantomData,
}
let range = old_length as u32..self.data.len() as u32;
Range::from_index_range(range, self)
}
/// Clears the arena keeping all allocations