Implement element getters for n-tuples#6591
Closed
brendanzab wants to merge 5 commits intorust-lang:incomingfrom
Closed
Implement element getters for n-tuples#6591brendanzab wants to merge 5 commits intorust-lang:incomingfrom
brendanzab wants to merge 5 commits intorust-lang:incomingfrom
Conversation
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"); ~~~
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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::preludeso you can use them from regular Rust code.Here is an example of one of the getters in use: