-
Notifications
You must be signed in to change notification settings - Fork 14k
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
Feature gate: #![feature(exact_length_collection)]
This is a tracking issue for exact length collection, concerning originally one but after discussion two new APIs on iterators:
exactly_one()to collect the one and only element from an iteratorcollect_array()to collect an iterator into an array of an exact predetermined length.
Public API
// trait Iterator
// note: unlike itertools, returns an Option, not a result as per ACP
fn exactly_one(self) -> Option<Self::Item>
where
Self: Sized;
fn collect_array<const N: usize>(self) -> Option<[Self::Item; N]>
where
Self: Sized;Steps / History
(Remember to update the S-tracking-* label when checking boxes.)
- ACP:
onlyon iterators libs-team#676 - Implementation: implement
Iterator::{exactly_one, collect_array}#149270 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.
Footnotes
theemathas
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.