From 3623c54fb72d05c25ca8b5fbe48927db6c8ce8bc Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Sat, 22 Jun 2024 18:19:55 -0700 Subject: [PATCH] [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. --- naga/src/arena.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/naga/src/arena.rs b/naga/src/arena.rs index c306e3f1f9..7a6556499d 100644 --- a/naga/src/arena.rs +++ b/naga/src/arena.rs @@ -185,10 +185,7 @@ impl Iterator for Range { 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 }