pub trait SameOrElseExtwhere
Self: Eq,{
// Required method
fn same_or_else(self, _: Self, _: impl FnOnce() -> Self) -> Self;
}
Required Methods§
sourcefn same_or_else(self, _: Self, _: impl FnOnce() -> Self) -> Self
fn same_or_else(self, _: Self, _: impl FnOnce() -> Self) -> Self
Check if self
and other
are equal, if so, return self
, otherwise return the result of f()
.
Object Safety§
This trait is not object safe.