reductor 0.0.12

Generic abstractions for combining and nesting reduction patterns for iterables.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/// Wrapper around `T` that pointedly does NOT implement [`Default`], even though `T` might.
#[repr(transparent)]
#[derive(Debug, Clone, Copy)]
pub struct NonEmptyState<T>(pub(super) T);

impl<T> From<T> for NonEmptyState<T> {
    fn from(v: T) -> Self {
        Self(v)
    }
}

impl<T> Default for NonEmptyState<Option<T>> {
    fn default() -> Self {
        Self(None)
    }
}