Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Default for iterators #261

Merged

Conversation

KamilaBorowska
Copy link
Contributor

@KamilaBorowska KamilaBorowska commented May 30, 2023

This matches Default implementations for HashMap and HashSet introduced in Rust 1.70 (rust-lang/rust#99929).

@KamilaBorowska KamilaBorowska force-pushed the iter-default-implementation branch from db9016d to bcdedde Compare May 30, 2023 16:43
This matches Default implementations for HashMap and HashSet
introduced in Rust 1.70.
@KamilaBorowska KamilaBorowska force-pushed the iter-default-implementation branch from bcdedde to 704bf5a Compare May 31, 2023 07:39
@@ -438,6 +480,14 @@ impl<K, V: fmt::Debug> fmt::Debug for ValuesMut<'_, K, V> {
}
}

impl<K, V> Default for ValuesMut<'_, K, V> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, oddly std left this out, but I think it's fine.

@cuviper
Copy link
Member

cuviper commented Jun 6, 2023

This matches Default implementations for HashMap and HashSet introduced in Rust 1.70

That actually did not include hash_map/hash_set iterators, but between the precedent in btree and slice iterators, I think it's still ok for us to add it here. They're trivial anyway.

@cuviper cuviper merged commit d62f837 into indexmap-rs:master Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants