|
|
|
@ -134,7 +134,7 @@ where U: IntoIterator<Item = T>
|
|
|
|
|
false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/// Map the single value with this function
|
|
|
|
|
/// Map the many value with this function
|
|
|
|
|
#[inline] pub fn map_many<F, A>(self, fun: F) -> MaybeMany<T, A>
|
|
|
|
|
where F: FnOnce(U) -> A,
|
|
|
|
|
A: IntoIterator<Item=T>
|
|
|
|
@ -146,6 +146,16 @@ where U: IntoIterator<Item = T>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Mutate the many value with this function.
|
|
|
|
|
#[inline] pub fn on_many<F, A>(&mut self, fun: F) -> Option<A>
|
|
|
|
|
where F: FnOnce(&mut U) -> A,
|
|
|
|
|
{
|
|
|
|
|
match self {
|
|
|
|
|
Self::Many(ref mut m) => Some(fun(m)),
|
|
|
|
|
_ => None
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Map the single value with this function
|
|
|
|
|
#[inline] fn map_one<F>(self, fun: F) -> MaybeMany<T,U>
|
|
|
|
|
where F: FnOnce(T) -> T
|
|
|
|
|