diff --git a/naga/src/arena.rs b/naga/src/arena.rs index 1bd6007c1..eb6b618c8 100644 --- a/naga/src/arena.rs +++ b/naga/src/arena.rs @@ -89,7 +89,7 @@ impl Handle { } } - /// Returns the zero-based index of this handle. + /// Returns the index of this handle. pub const fn index(self) -> usize { self.index.get() as usize } @@ -221,13 +221,13 @@ impl Range { } } - /// Return the zero-based index range covered by `self`. - pub fn zero_based_index_range(&self) -> ops::Range { + /// Return the index range covered by `self`. + pub fn index_range(&self) -> ops::Range { self.inner.clone() } - /// Construct a `Range` that covers the zero-based indices in `inner`. - pub fn from_zero_based_index_range(inner: ops::Range, arena: &Arena) -> Self { + /// Construct a `Range` that covers the indices in `inner`. + pub fn from_index_range(inner: ops::Range, arena: &Arena) -> Self { // Since `inner` is a `Range`, we only need to check that // the start and end are well-ordered, and that the end fits // within `arena`. diff --git a/naga/src/compact/handle_set_map.rs b/naga/src/compact/handle_set_map.rs index b0d6c2e6a..57a2749f8 100644 --- a/naga/src/compact/handle_set_map.rs +++ b/naga/src/compact/handle_set_map.rs @@ -137,7 +137,7 @@ impl HandleMap { /// /// Use `compacted_arena` to bounds-check the result. pub fn adjust_range(&self, range: &mut Range, compacted_arena: &Arena) { - let mut index_range = range.zero_based_index_range(); + let mut index_range = range.index_range(); let compacted; if let Some(first) = index_range.find_map(|i| self.new_index[i as usize]) { // The first call to `find_map` mutated `index_range` to hold the @@ -155,6 +155,6 @@ impl HandleMap { } else { compacted = 0..0; }; - *range = Range::from_zero_based_index_range(compacted, compacted_arena); + *range = Range::from_index_range(compacted, compacted_arena); } }