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

#829 in Data structures

Download history 495/week @ 2025-04-11 453/week @ 2025-04-18 577/week @ 2025-04-25 442/week @ 2025-05-02 774/week @ 2025-05-09 468/week @ 2025-05-16 386/week @ 2025-05-23 303/week @ 2025-05-30 698/week @ 2025-06-06 646/week @ 2025-06-13 491/week @ 2025-06-20 347/week @ 2025-06-27 383/week @ 2025-07-04 577/week @ 2025-07-11 595/week @ 2025-07-18 530/week @ 2025-07-25

2,173 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

~145KB