[naga] Use Handle::new, don't construct the Handle directly.

In preparation for making `Handle` fields private to another module,
have the `Iterator` implementation for `arena::Range` call
`Handle::new` to construct the handle being produced, rather than
building it using a struct literal.
This commit is contained in:
Jim Blandy
2024-06-22 18:19:55 -07:00
parent 3e20909ade
commit 3623c54fb7

View File

@@ -185,10 +185,7 @@ impl<T> Iterator for Range<T> {
if self.inner.start < self.inner.end {
let next = self.inner.start;
self.inner.start += 1;
Some(Handle {
index: NonMaxU32::new(next).unwrap(),
marker: self.marker,
})
Some(Handle::new(NonMaxU32::new(next).unwrap()))
} else {
None
}