cloudhead / cloudhead/nonempty

Flesh out functionality

Open
#18 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
74
Forks
30
PR merge metrics
No merged PRs in 30d

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:

- [x] `append`
- [x] ~~`as_mut_ptr`~~ N/A (memory is not contiguous)
- [x] ~~`as_mut_slice`~~ N/A
- [x] ~~`as_ptr`~~ N/A
- [x] ~~`as_slice`~~ N/A
- [x] `capacity`
- [ ] `chunks`
- [ ] `chunks_exact`
- [ ] `chunks_exact_mut`
- [ ] `chunks_mut`
- [x] `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`
- [x] `contains`
- [x] `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`
- [ ] `drain_filter` - same as above
- [ ] `ends_with`
- [ ] `eq_ignore_ascii_case`
- [ ] `extend_from_slice`
- [x] `first`
- [x] `first_mut`
- [ ] `from_raw_parts` - this seems unecessary
- [x] `get`
- [x] `get_mut`
- [ ] `get_unchecked`
- [ ] `get_unchecked_mut`
- [x] `insert`
- [x] `into_boxed_slice`
- [ ] `into_raw_parts` - not sure about this one
- [ ] `is_ascii`
- [x] `is_empty`
- [ ] `is_sorted`
- [ ] `is_sorted_by_key`
- [x] `iter`
- [x] `iter_mut`
- [ ] `join`
- [x] `last`
- [x] `last_mut`
- [ ] `leak` - seems specialised
- [x] `len`
- [ ] `make_ascii_lowercase`
- [ ] `make_ascii_uppercase`
- [x] `new`
- [ ] `partition_at_index`
- [ ] `partition_at_index_by`
- [ ] `partition_at_index_by_key`
- [ ] `partition_deup`
- [ ] `partition_deup_by`
- [ ] `partition_deup_by_key`
- [x] `pop`
- [x] `push`
- [ ] `rchunks`
- [ ] `rchunks_exact`
- [ ] `rchunks_exact_mut`
- [ ] `rchunks_mut`
- [ ] `remove` - should give back `Vec`
- [ ] `remove_item` - should give back `Vec`
- [ ] `repeat`
- [ ] `reserve`
- [ ] `reserve_exact`
- [ ] `resize` - possibly just work on the tail `Vec`
- [ ] `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`
- [x] `split`
- [ ] `split_at`
- [ ] `split_at_mut`
- [x] `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`
- [x] `to_vec` - the `Into` impl does this
- [ ] `try_reserve`
- [ ] `try_reserve_exact`
- [ ] `windows`
- [ ] `with_capacity`
- [ ] `From> for Vec` - https://github.com/cloudhead/nonempty/pull/17#issuecomment-600217655

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.