Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct the implementation of Debug for ValuesMut and IntoValues stru…
…ctures Previously the implementation of Debug trait for ValuesMut was ``` impl<K, V> fmt::Debug for ValuesMut<'_, K, V> where K: fmt::Debug, V: fmt::Debug, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list().entries(self.inner.iter()).finish() } } ``` It is strange, because `self.inner.iter()` return an iterator with element of type `(&’a K, &’a V)`. The same is true when we look at the old implementation of Debug trait for the `IntoValues` structure. Here we have mistake ``` impl<K: Debug, V: Debug, A: Allocator + Clone> fmt::Debug for IntoValues<K, V, A> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list() .entries(self.inner.iter().map(|(k, _)| k)) .finish() } } ``` because with the function `self.inner.iter().map(|(k, _)| k)` we return iterator with element of type 'a K.
- Loading branch information