Flesh out functionality
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reviewing the existing Vec implementation and the checklist in this issue. Decide which methods fit NonEmpty semantics, then resolve the unchecked, length-changing, and conversion cases before coding. Done means the selected entries are implemented or explicitly rejected, with the checklist reflecting those decisions; no files or tests are named.
Written by the indexing model from the issue text.
Description
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 -
N/A (memory is not contiguous)as_mut_ptr -
N/Aas_mut_slice -
N/Aas_ptr -
N/Aas_slice -
capacity -
chunks -
chunks_exact -
chunks_exact_mut -
chunks_mut -
clone_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 rename -
concat -
connect -
contains -
copy_from_slice-we haveLooking into the semantics of this, I think it doesn't suitfrom_slicebut aCopyversion would be goodNonEmptyafter all. -
copy_within -
clear- we probably don't want this -
dedup -
dedup_by -
drain- wouldn't make sense forNonEmptyunless it returned aVecrather thanDrain -
drain_filter- same as above -
ends_with -
eq_ignore_ascii_case -
extend_from_slice -
first -
first_mut -
from_raw_parts- this seems unecessary -
get -
get_mut -
get_unchecked -
get_unchecked_mut -
insert -
into_boxed_slice -
into_raw_parts- not sure about this one -
is_ascii -
is_empty -
is_sorted -
is_sorted_by_key -
iter -
iter_mut -
join -
last -
last_mut -
leak- seems specialised -
len -
make_ascii_lowercase -
make_ascii_uppercase -
new -
partition_at_index -
partition_at_index_by -
partition_at_index_by_key -
partition_deup -
partition_deup_by -
partition_deup_by_key -
pop -
push -
rchunks -
rchunks_exact -
rchunks_exact_mut -
rchunks_mut -
remove- should give backVec -
remove_item- should give backVec -
repeat -
reserve -
reserve_exact -
resize- possibly just work on the tailVec -
resize_default -
resize_wtih -
retain- unsure if this should be kept -
reverse -
rotate_left -
rotate_right -
rsplit -
rsplit_mut -
rsplitn -
rsplitn_mut -
set_len -
shrink_to- should be greater than 1 -
shrink_to_fit -
sort -
sort_by -
sort_by_cahced_key -
sort_by_key -
sort_unstable -
sort_unstable_by -
sort_unstable_by_key -
splice -
split -
split_at -
split_at_mut -
split_first -
split_first_mut -
split_last -
split_last -
split_last_mut -
split_mut -
split_off -
splitn -
splitn_mut -
starts_with -
swap -
swap_with_slice -
to_ascii_lowercase -
to_ascii_uppercase -
to_vec- theIntoimpl does this -
try_reserve -
try_reserve_exact -
windows -
with_capacity -
From<NonEmpty<T>> for Vec<T>- https://github.com/cloudhead/nonempty/pull/17#issuecomment-600217655
- Dominant language
- Rust
- Stars
- 74
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudhead/nonempty
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
All issues in cloudhead/nonempty
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
solana-foundation/pay-kit#341 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
anthropics/buffa#487 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
arkworks-rs/algebra#1161 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
lbjlaq/Antigravity-Manager#3525 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rustdesk/rustdesk-server#708 ·