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