diff --git a/util/registry/src/lib.rs b/util/registry/src/lib.rs index 19be9d4..7affce3 100644 --- a/util/registry/src/lib.rs +++ b/util/registry/src/lib.rs @@ -292,6 +292,13 @@ impl<'a, K, T> Iterator for Entries<'a, K, T> { } } } + + fn size_hint(&self) -> (usize, Option) { + match &self.inner { + EntriesInner::Direct { iter, .. } => iter.size_hint(), + EntriesInner::Raw { iter, .. } => iter.size_hint(), + } + } } /// Iterator of entry references of a tag. @@ -308,6 +315,11 @@ impl<'a, K, T> Iterator for OfTag<'a, K, T> { fn next(&mut self) -> Option { self.inner.next().and_then(|i| self.registry.of_raw(i)) } + + #[inline] + fn size_hint(&self) -> (usize, Option) { + self.inner.size_hint() + } } /// Iterator of entry values. @@ -323,6 +335,11 @@ impl<'a, K, T> Iterator for Values<'a, K, T> { fn next(&mut self) -> Option { self.inner.next().and_then(RefEntry::value) } + + #[inline] + fn size_hint(&self) -> (usize, Option) { + self.inner.size_hint() + } } impl<'a, K, T> IntoIterator for &'a Registry { @@ -658,11 +675,11 @@ impl crate::key::Root for rimecraft_identifier::vanilla::Identifier { } } -#[cfg(feature = "vanilla-registry")] +#[cfg(feature = "vanilla-identifier")] #[doc = "`Registry` using vanilla `Identifier`."] pub type VanillaRegistry = Registry; -#[cfg(feature = "vanilla-registry")] +#[cfg(feature = "vanilla-identifier")] #[doc = "Mutable `Registry` using vanilla `Identifier`."] pub type VanillaRegistryMut = RegistryMut; diff --git a/util/registry/src/tag.rs b/util/registry/src/tag.rs index 1dcb590..10e0d53 100644 --- a/util/registry/src/tag.rs +++ b/util/registry/src/tag.rs @@ -102,6 +102,11 @@ impl<'a, K, T> Iterator for Iter<'a, K, T> { ) }) } + + #[inline] + fn size_hint(&self) -> (usize, Option) { + self.inner.size_hint() + } } #[cfg(feature = "serde")]