You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is this the best order for the tuple in split_last_chunk? Consistency with split_last would have it be -> Option<(&[T;N], &[T])> as was ACPed, but it might be confusing to have the two slice-like things in the opposite order from every other API I can think of that returns two subslices of the original. In Add slice::{split_,}{first,last}_chunk{,_mut} #95198 (comment), @scottmcm expected -> Option<(&[T;N], &[T])> for split_first_chunk, but for it to be -> Option<(&[T], &[T;N])> in split_last_chunk so the tuple is "in order", in some sense.
Feature gate:
#![feature(slice_first_last_chunk)]This is a tracking issue for the
slice::{split_,}{first,last}_chunk{,_mut}API.Public API
2024-09-06: Most of this is stable now, except for the const-ness of the
mutmethods.Note that this mirrors the existing, already-stabilised API:
Steps / History
feature(const_slice_split_at_mut)#101804 is stableUnresolved Questions
split_last_chunk? Consistency withsplit_lastwould have it be-> Option<(&[T;N], &[T])>as was ACPed, but it might be confusing to have the two slice-like things in the opposite order from every other API I can think of that returns two subslices of the original. In Add slice::{split_,}{first,last}_chunk{,_mut} #95198 (comment), @scottmcm expected-> Option<(&[T;N], &[T])>forsplit_first_chunk, but for it to be-> Option<(&[T], &[T;N])>insplit_last_chunkso the tuple is "in order", in some sense.Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/api-change-proposals.html ↩
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩