7 releases
0.2.3 | Nov 16, 2021 |
---|---|
0.2.2 | Nov 10, 2021 |
0.2.0 | Aug 30, 2021 |
0.1.2 | Jul 23, 2020 |
0.1.0 | Dec 15, 2019 |
#1629 in Data structures
752 downloads per month
Used in 14 crates
(6 directly)
12KB
286 lines
NonEmpty
vector implementation, ensure non-emptiness by construction.
Inherits Vec
's immutable methods through Deref
trait, not implements DerefMut
.
The differences from Vec
:
len
returnsNonZeroUsize
,is_empty
always returnsfalse
.first(_mut)
,last(_mut)
,split_first(_mut)
,split_last(_mut)
don't returnOption
.pop
returnsNone
if there is only one element in it.
More usages please look at the embedded unit testing.
Dependencies
~165KB