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:
parent
dd9f53080a
commit
685eadb171
4 changed files with 24 additions and 13 deletions
|
@ -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) }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue