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
We should flesh out the functionality of nonempty. A lot of it would just be the Vec implementation.
Enumerating these for clarity and also to comment on which ones we may not want:
append
as_mut_ptr N/A (memory is not contiguous)
as_mut_slice N/A
as_ptr N/A
as_slice N/A
capacity
chunks
chunks_exact
chunks_exact_mut
chunks_mut
clone_from_slice - we use from_slice, we should rename This doesn't make sense either since it's just copying a slice's contents in, but we can't guarantee a length of 1 without panicing.
concat
connect
contains
copy_from_slice - we have from_slice but a Copy version would be good Looking into the semantics of this, I think it doesn't suit NonEmpty after all.
copy_within
clear - we probably don't want this
dedup
dedup_by
drain - wouldn't make sense for NonEmpty unless it returned a Vec rather than Drain
We should flesh out the functionality of
nonempty. A lot of it would just be theVecimplementation.Enumerating these for clarity and also to comment on which ones we may not want:
appendN/A (memory is not contiguous)as_mut_ptrN/Aas_mut_sliceN/Aas_ptrN/Aas_slicecapacitychunkschunks_exactchunks_exact_mutchunks_mutclone_from_slice-we useThis doesn't make sense either since it's just copying a slice's contents in, but we can't guarantee a length of 1 without panicing.from_slice, we should renameconcatconnectcontainscopy_from_slice-we haveLooking into the semantics of this, I think it doesn't suitfrom_slicebut aCopyversion would be goodNonEmptyafter all.copy_withinclear- we probably don't want thisdedupdedup_bydrain- wouldn't make sense forNonEmptyunless it returned aVecrather thanDraindrain_filter- same as aboveends_witheq_ignore_ascii_caseextend_from_slicefirstfirst_mutfrom_raw_parts- this seems unecessarygetget_mutget_uncheckedget_unchecked_mutinsertinto_boxed_sliceinto_raw_parts- not sure about this oneis_asciiis_emptyis_sortedis_sorted_by_keyiteriter_mutjoinlastlast_mutleak- seems specialisedlenmake_ascii_lowercasemake_ascii_uppercasenewpartition_at_indexpartition_at_index_bypartition_at_index_by_keypartition_deuppartition_deup_bypartition_deup_by_keypoppushrchunksrchunks_exactrchunks_exact_mutrchunks_mutremove- should give backVecremove_item- should give backVecrepeatreservereserve_exactresize- possibly just work on the tailVecresize_defaultresize_wtihretain- unsure if this should be keptreverserotate_leftrotate_rightrsplitrsplit_mutrsplitnrsplitn_mutset_lenshrink_to- should be greater than 1shrink_to_fitsortsort_bysort_by_cahced_keysort_by_keysort_unstablesort_unstable_bysort_unstable_by_keysplicesplitsplit_atsplit_at_mutsplit_firstsplit_first_mutsplit_lastsplit_lastsplit_last_mutsplit_mutsplit_offsplitnsplitn_mutstarts_withswapswap_with_sliceto_ascii_lowercaseto_ascii_uppercaseto_vec- theIntoimpl does thistry_reservetry_reserve_exactwindowswith_capacityFrom<NonEmpty<T>> for Vec<T>- Implement and test IntoIterator #17 (comment)