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

#1420 in Data structures

Download history 165/week @ 2025-10-02 257/week @ 2025-10-09 298/week @ 2025-10-16 187/week @ 2025-10-23 302/week @ 2025-10-30 436/week @ 2025-11-06 181/week @ 2025-11-13 423/week @ 2025-11-20 190/week @ 2025-11-27 268/week @ 2025-12-04 192/week @ 2025-12-11 226/week @ 2025-12-18 167/week @ 2025-12-25 222/week @ 2026-01-01 98/week @ 2026-01-08 201/week @ 2026-01-15

721 downloads per month
Used in 15 crates (6 directly)

MIT license

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 returns NonZeroUsize, is_empty always returns false.
  • first(_mut), last(_mut), split_first(_mut), split_last(_mut) don't return Option.
  • pop returns None if there is only one element in it.

More usages please look at the embedded unit testing.

Dependencies

~170KB