mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-21 06:50:59 +01:00
[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:
1 parent
a7d4d2c79f
commit
3e20909ade
1 file changed
+2
-4
+2
-4
@@ -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
|
||||
|
||||
Reference in new issue
Block a user