move core result into core utils
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
5cb0a5f676
commit
c769fcc347
12 changed files with 2 additions and 3 deletions
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) }
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue