Remove when_else

Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
This commit is contained in:
Joseph T. Lyons 2023-12-07 12:37:07 -05:00
parent 393be3cedf
commit 7c19650a40
3 changed files with 20 additions and 32 deletions

View file

@ -69,24 +69,6 @@ pub trait IntoElement: Sized {
self.map(|this| if condition { then(this) } else { this })
}
fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
otherwise: impl FnOnce(Self) -> Self,
) -> Self
where
Self: Sized,
{
self.map(|this| {
if condition {
then(this)
} else {
otherwise(this)
}
})
}
fn when_some<T>(self, option: Option<T>, then: impl FnOnce(Self, T) -> Self) -> Self
where
Self: Sized,