pub trait Also: Sized {
#[inline]
fn also(mut self, f: impl FnOnce(&mut Self)) -> Self {
f(&mut self);
self
}
#[inline]
fn try_also<E>(mut self, f: impl FnOnce(&mut Self) -> Result<(), E>) -> Result<Self, E> {
f(&mut self)?;
Ok(self)
}
}
impl<T: Sized> Also for T {}