Files
serai/patches/option-ext/src/lib.rs
2025-11-25 17:05:30 -05:00

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)
}
}