add is_not_found as Error member function; tweak interface; add doc comments

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-10-04 17:07:31 +00:00 committed by strawberry
parent dd9f53080a
commit 685eadb171
4 changed files with 24 additions and 13 deletions

View file

@ -1,5 +1,5 @@
use super::Result;
use crate::{error, Error};
use crate::Error;
pub trait NotFound<T> {
#[must_use]
@ -8,5 +8,5 @@ pub trait NotFound<T> {
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) }
fn is_not_found(&self) -> bool { self.as_ref().is_err_and(Error::is_not_found) }
}