trait Sealed {}
impl<T, E> Sealed for Result<T, E> {}
#[doc = crate::_tags!(result)]
#[doc = crate::_doc_location!("code/result")]
#[cfg_attr(nightly_doc, doc(notable_trait))]
#[expect(private_bounds, reason = "Sealed")]
pub trait ResultExt<T, E>: Sealed {
#[must_use]
fn has<U: PartialEq<T>>(&self, x: &U) -> bool;
#[must_use]
fn has_err<F: PartialEq<E>>(&self, f: &F) -> bool;
}
impl<T, E> ResultExt<T, E> for Result<T, E> {
fn has<U: PartialEq<T>>(&self, x: &U) -> bool {
self.as_ref().is_ok_and(|y| x == y)
}
fn has_err<F: PartialEq<E>>(&self, f: &F) -> bool {
self.as_ref().err().is_some_and(|e| f == e)
}
}