Skip to content

Fix issue #11216 - Replace std::hashmap::{each_key, each_value} with iterators #11242

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

Closed
wants to merge 1 commit into from

Conversation

Dretch
Copy link
Contributor

@Dretch Dretch commented Dec 31, 2013

No description provided.

@alexcrichton
Copy link
Member

I think you can actually avoid making two new structures as well::

type HashMapKeyIterator<'a, K, V> = Map<'static, (&'a K, &'a V), &'a V, HashMapIterator<'a, K, V>>;

pub fn keys<'a>(&'a self) -> HashMapKeyIterator<'a, K, V> {           
    self.iter().map(|(_, v)| v)                                         
}                                                                       

A little wordy on the type definition, but it gets the job done!

@alexcrichton
Copy link
Member

Two more minor things, then this is good to go:

  • Could you make the type definitions pub type so external callers can use them?
  • Could you squash these into one commit?

Thanks!

@Dretch
Copy link
Contributor Author

Dretch commented Jan 1, 2014

@alexcrichton

I have implemented your requests. r?

@alexcrichton
Copy link
Member

Thanks, and nice work!

bors added a commit that referenced this pull request Jan 2, 2014
@bors bors closed this Jan 2, 2014
flip1995 pushed a commit to flip1995/rust that referenced this pull request Aug 11, 2023
…giraffate

New lint `ignored_unit_patterns`

This idea comes from rust-lang#11238. I've put the lint in `pedantic` as it might trigger numerous positives (three in Clippy itself).

changelog: [`ignored_unit_patterns`]: new lint
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.

4 participants