From 3e20909ade241d67a756003cf8790a3a663b201e Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Sat, 22 Jun 2024 18:11:55 -0700 Subject: [PATCH] [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. --- naga/src/arena.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/naga/src/arena.rs b/naga/src/arena.rs index 27c858f562..c306e3f1f9 100644 --- a/naga/src/arena.rs +++ b/naga/src/arena.rs @@ -378,10 +378,8 @@ impl Arena { /// Get the range of handles from a particular number of elements to the end. pub fn range_from(&self, old_length: usize) -> Range { - 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