Open greyblake opened 3 months ago
At the moment boundaries can be set only within <T: ..>, it's not possible to set boundaries with where clause.
<T: ..>
where
One particular usecase where it would be helpful is this one:
#[nutype( validate(predicate = |c| c.into_iter().next().is_some()), )] struct NonEmpty<C>(C) where for<'a> &'a C: IntoIterator;
This would allow to define NonEmpty collection, regardless of what kind of collection it is.
NonEmpty
See also https://github.com/greyblake/nutype/issues/130#issuecomment-2212415460
At the moment boundaries can be set only within
<T: ..>
, it's not possible to set boundaries withwhere
clause.One particular usecase where it would be helpful is this one:
This would allow to define
NonEmpty
collection, regardless of what kind of collection it is.See also https://github.com/greyblake/nutype/issues/130#issuecomment-2212415460