non-empty-collections

Crates.ionon-empty-collections
lib.rsnon-empty-collections
version0.1.9
sourcesrc
created_at2018-07-17 18:13:07.675027
updated_at2019-09-17 16:04:24.151038
descriptionNon-empty hash-map and hash-set implementations
homepage
repositoryhttps://gitlab.com/mexus/non-empty-collections/
max_upload_size
id74763
size56,951
Denis (mexus)

documentation

https://docs.rs/non-empty-collections/

README

non-empty-collections

Non-empty hash map and hash set implementations based on [indexmap::IndexMap] and [indexmap::IndexSet] respectively, which are guaranteed to be non-empty by the type system of Rust.

pipeline status crates.io docs.rs

[Release docs]

[Master docs]

Currently not all the methods of IndexMap or IndexSet are ported to NonEmptyIndexMap and NonEmptyIndexSet, so if you are missing something, PRs are welcome! :)

Right now both implementations are too naïve: non-emptiness is achieved by declaring map and set types as a pair of an element and the rest of the collection. While the idea itself is not bad, it adds an additional overhead on basically every operation since we have to execute everything twice: on the first element and then on the rest.

License: MIT/Apache-2.0

Commit count: 27

cargo fmt