It provides a NonEmpty<T> type, which behaves (mostly) like a Vec, but guarantees that there is at least one element. Specifically for the input layer, there are a bunch of places where we want to ensure that Vecs are non-empty and this could be a nice way of expressing it...
I've come across this crate and it seems like it could be useful: https://crates.io/crates/nonempty
It provides a
NonEmpty<T>
type, which behaves (mostly) like aVec
, but guarantees that there is at least one element. Specifically for the input layer, there are a bunch of places where we want to ensure thatVec
s are non-empty and this could be a nice way of expressing it...What do you think @dalonsoa?