From 460cf7db9107100640a9eb631e20a9b1aa09e759 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Tue, 2 Aug 2022 22:52:16 +0100 Subject: [PATCH] Deny missing docs in HashMap and document two public structs --- agb/src/hash_map.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/agb/src/hash_map.rs b/agb/src/hash_map.rs index 36b0268..2b16070 100644 --- a/agb/src/hash_map.rs +++ b/agb/src/hash_map.rs @@ -1,3 +1,4 @@ +#![deny(missing_docs)] //! A lot of the documentation for this module was copied straight out of the rust //! standard library. The implementation however is not. use alloc::vec::Vec; @@ -291,6 +292,10 @@ where } } +/// An iterator over entries of a [`HashMap`] +/// +/// This struct is created using the `into_iter()` method on [`HashMap`]. See its +/// documentation for more. pub struct Iter<'a, K: 'a, V: 'a> { map: &'a HashMap, at: usize, @@ -324,6 +329,10 @@ impl<'a, K, V> IntoIterator for &'a HashMap { } } +/// An iterator over entries of a [`HashMap`] +/// +/// This struct is created using the `into_iter()` method on [`HashMap`] as part of its implementation +/// of the IntoIterator trait. pub struct IterOwned { map: HashMap, at: usize, @@ -348,6 +357,10 @@ impl Iterator for IterOwned { } } +/// An iterator over entries of a [`HashMap`] +/// +/// This struct is created using the `into_iter()` method on [`HashMap`] as part of its implementation +/// of the IntoIterator trait. impl IntoIterator for HashMap { type Item = (K, V); type IntoIter = IterOwned;