Skip to content

Using NonEmpty with custom containers #28

@ronnodas

Description

@ronnodas

I want to use NonEmpty<C> for my own collection types C. Although I can implement some methods and traits on this, I don't see a way to construct an object of such a type. Any such constructor probably needs to be unsafe, since the whole point of the crate is to be able to add the non-empty guarantees. But maybe there's a good reason that the crate exposes separate from_vec_unchecked, from_hashset_unchecked etc instead of a single from_inner_unchecked for arbitrary inner types?

Of course I can have my own NonEmpty wrapper with the same semantics, but that seems redundant and awkward given that I'm already using mitsein.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions