2024-09-12 00:01:25 +00:00
|
|
|
use super::Result;
|
2024-10-04 17:07:31 +00:00
|
|
|
use crate::Error;
|
2024-09-12 00:01:25 +00:00
|
|
|
|
|
|
|
|
pub trait NotFound<T> {
|
|
|
|
|
#[must_use]
|
|
|
|
|
fn is_not_found(&self) -> bool;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl<T> NotFound<T> for Result<T, Error> {
|
|
|
|
|
#[inline]
|
2024-10-04 17:07:31 +00:00
|
|
|
fn is_not_found(&self) -> bool { self.as_ref().is_err_and(Error::is_not_found) }
|
2024-09-12 00:01:25 +00:00
|
|
|
}
|