Closed
Description
Feature gate: #![feature(array_zip)]
This is a tracking issue for the zip
method on arrays.
Just like Iterator::zip
combines two iterators into one, [T; N]::zip()
returns a new array where every element is a tuple where the first element comes from the first array, and the second element comes from the second array. In other words, it zips two arrays together, into a single one.
let x = [1, 2, 3];
let y = [4, 5, 6];
let z = x.zip(y);
assert_eq!(z, [(1, 4), (2, 5), (3, 6)]);
Public API
pub fn zip<U>(self, rhs: [U; N]) -> [(T, U); N]
Steps / History
- Implementation: Added [T; N]::zip() #79451
- Stabilization PR
Unresolved Questions
[...] This seems like a pretty niche feature to me personally, but I can understand that there are situations when you might want it. I'm not sure if the libs team has a standard for "fill in the missing methods" PRs like this.
overlap with potential std::iter::Zip trait [...]
Metadata
Metadata
Assignees
Labels
Area: `[T; N]`Category: An issue tracking the progress of sth. like the implementation of an RFCLibs issues that are tracked on the team's project board.Relevant to the library API team, which will review and decide on the PR/issue.This PR / issue is in PFCP or FCP with a disposition to close it.The final comment period is finished for this PR / Issue.