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 element getters for n-tuples #6591

Closed
wants to merge 5 commits into from

Conversation

brendanzab
Copy link
Member

This commit implements element getters for tuples with an arity of 2 to 12. The getters return references to the elements, so no copying occurs. The traits are re-exported in core::prelude so you can use them from regular Rust code.

Here is an example of one of the getters in use:

assert_eq!((2, "hi", 75.0).n1(), &"hi");

bors added a commit that referenced this pull request May 18, 2013
This commit implements element getters for tuples with an arity of 2 to 12. The getters return references to the elements, so no copying occurs. The traits are re-exported in `core::prelude` so you can use them from regular Rust code.

Here is an example of one of the getters in use:

~~~rust
assert_eq!((2, "hi", 75.0).n1(), &"hi");
~~~
@bors bors closed this May 18, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jan 30, 2021
`manual_filter_map` and `manual_find_map`

changelog: Add `manual_filter_map` and replace `find_map` with `manual_find_map`

Replaces rust-lang#6453

Fixes rust-lang#3188
Fixes rust-lang#4193

~Depends on rust-lang#6567 (to fix an internal lint false positive)~

This replaces `filter_map` and `find_map` with `manual_filter_map` and `manual_find_map` respectively. However, `filter_map` is left in place since it is used for a variety of other cases. See discussion in rust-lang#6453.
flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 22, 2021
Deprecate `filter_map`

Since rust-lang#6591, `filter_map` does not even lint `filter().map()`. The cases that are still linted make no sense IMO. So this just removes/deprecates it.

changelog: Deprecate `filter_map` lint

Closes rust-lang#3424
Fixes rust-lang#7050
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.

3 participants