vec1 icon indicating copy to clipboard operation
vec1 copied to clipboard

Rust `Vec<T>` wrapper that gurantees to contain at least 1 element

Results 8 vec1 issues
Sort by recently updated
recently updated
newest added

Is it possible for methods like `max()` to play nicely with a `Vec1`? Since we know there is at least one element, we should know there is a max. `Vec::max()`...

This project is licensed under the `Apache-2.0 OR MIT` licenses, but neither license text is present in this repo, even though both licenses require the license text be present in...

Making this struct's inner type a generic parameter would mean it could also be used with String, boxed slices, and borrowed slices. If Index doesn't provide enough features, an alternative...

`Vec1` does not uphold its non-empty guarantee in its `Vec1::drain` API. Here's an example: ```rust use std::mem; use vec1::vec1; fn main() { let mut xs1 = vec1![0i32, 1, 2, 3];...

**TL;DR**: an error message starting with a lowercase letter and lacking a period at the end might "compose" better. --- Currently, the error message reads https://github.com/rustonaut/vec1/blob/bc8e2cee1e89fbfe5af68e20abb5dac09570c5e4/src/lib.rs#L156 which begins with an...

All of the methods which rely on the assumption of `len >= 1` use a safe `.unwrap()`. But why? using the `unsafe` version of `unwrap` would allow for guaranteed check...

The underlying slice has: ``` pub fn split_first(&self) -> Option ``` But for `Vec1` the `Option` is always `Some`. Could we get a dedicated `split_first` on the `Vec1`.