continuwuity/src/core/utils/result/not_found.rs
Jason Volk c769fcc347 move core result into core utils
Signed-off-by: Jason Volk <jason@zemos.net>
2024-10-26 18:50:29 -04:00

12 lines
249 B
Rust

use super::Result;
use crate::Error;
pub trait NotFound<T> {
#[must_use]
fn is_not_found(&self) -> bool;
}
impl<T> NotFound<T> for Result<T, Error> {
#[inline]
fn is_not_found(&self) -> bool { self.as_ref().is_err_and(Error::is_not_found) }
}