not_empty

Slices and vectors that are statically guaranteed to be not empty.

![Build Status] ![Latest Version]

This crate is particularly useful for various operations on slices or vectors that would otherwise return an option now return the value with no performance penalty.

Usage

This crate is on crates.io and can be used by adding not_empty to your dependencies in your project's Cargo.toml:

toml [dependencies] not_empty = "0.1"

Documentation

View the full reference on docs.rs here.

Features

Note: A compiler error is thrown if both alloc and std features are enabled. Only choose up to one.

Only the std feature is enabled by default.

Motivation

There are other packages that solve this solution. When searching for my own, I primarily came across two other packages:

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.