mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 04:39:24 +00:00
9 lines
196 B
Rust
9 lines
196 B
Rust
|
|
pub trait OptionExt<T: PartialEq> {
|
||
|
|
fn contains(&self, x: &T) -> bool;
|
||
|
|
}
|
||
|
|
impl<T: PartialEq> OptionExt<T> for Option<T> {
|
||
|
|
fn contains(&self, x: &T) -> bool {
|
||
|
|
self.as_ref() == Some(x)
|
||
|
|
}
|
||
|
|
}
|