[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 committed 2024-06-24 12:42:02 -07:00
1 parent a7d4d2c79f
commit 3e20909ade
1 file changed
+2 -4
+2 -4
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