-
Notifications
You must be signed in to change notification settings - Fork 24
Add core::iter::chain method #154
Copy link
Copy link
Closed
Labels
ACP-acceptedAPI Change Proposal is accepted (seconded with no objections)API Change Proposal is accepted (seconded with no objections)T-libs-apiapi-change-proposalA proposal to add or alter unstable APIs in the standard librariesA proposal to add or alter unstable APIs in the standard libraries
Metadata
Metadata
Assignees
Labels
ACP-acceptedAPI Change Proposal is accepted (seconded with no objections)API Change Proposal is accepted (seconded with no objections)T-libs-apiapi-change-proposalA proposal to add or alter unstable APIs in the standard librariesA proposal to add or alter unstable APIs in the standard libraries
Type
Fields
Give feedbackNo fields configured for issues without a type.
Proposal
Problem statement
Add a convenient
IntoIteratorenabled function for chaining two iterators.Motivation, use-cases
core::iter::zip(added in Add function core::iter::zip rust#82917)Some examples from the rust-lang/rust repo
infcx .type_implements_trait(p.def_id, [ty.into()].into_iter().chain(p.substs.iter()), cx.param_env) .must_apply_modulo_regions() // vs infcx .type_implements_trait(p.def_id, iter::chain([ty.into()], p.substs.iter()), cx.param_env) .must_apply_modulo_regions()Solution sketches