From 356bc5fe6913e85b18a2cb355f30019cdfd6b146 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 21 Feb 2026 03:46:30 +0100 Subject: Also use source ranks for nested attributes --- common/object/src/lib.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'common/object/src/lib.rs') diff --git a/common/object/src/lib.rs b/common/object/src/lib.rs index a73de08..98e4834 100644 --- a/common/object/src/lib.rs +++ b/common/object/src/lib.rs @@ -160,7 +160,7 @@ impl<'a> Object<'a> { } #[inline] pub fn get_typed>(&self, index: usize) -> Option { - if T::ALIGNED { + if T::TYPE.is_aligned() { T::load_aligned(self.get_aligned(index)?) } else { T::load_unaligned(self.get_unaligned(index)?) @@ -326,13 +326,18 @@ pub struct EntriesIter<'a, T> { impl<'a, T: ValueLoad<'a>> Iterator for EntriesIter<'a, T> { type Item = (Tag, T); fn next(&mut self) -> Option { - if self.index >= self.object.tags.len() { - return None; - } else { + loop { + if self.index >= self.object.tags.len() { + return None; + } + if T::TYPE != self.object.offset_type(self.index) { + self.index += 1; + continue; + } let value = self.object.get_typed(self.index)?; let tag = self.object.tags[self.index]; self.index += 1; - Some((Tag(tag), value)) + return Some((Tag(tag), value)); } } } -- cgit v1.3