move core result into core utils
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
12
src/core/utils/result/not_found.rs
Normal file
12
src/core/utils/result/not_found.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
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) }
|
||||
}
|
||||
Reference in New Issue
Block a user