-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
auto merge of #6591 : bjz/rust/tuple-elements, r=thestinger
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"); ~~~
- Loading branch information
Showing
2 changed files
with
167 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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