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
|
@ -1,24 +0,0 @@
|
|||
use std::fmt::Display;
|
||||
|
||||
use tracing::Level;
|
||||
|
||||
use super::Result;
|
||||
use crate::error;
|
||||
|
||||
pub trait LogErr<T, E: Display> {
|
||||
#[must_use]
|
||||
fn err_log(self, level: Level) -> Self;
|
||||
|
||||
#[must_use]
|
||||
fn log_err(self) -> Self
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
self.err_log(Level::ERROR)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, E: Display> LogErr<T, E> for Result<T, E> {
|
||||
#[inline]
|
||||
fn err_log(self, level: Level) -> Self { self.inspect_err(|error| error::inspect_log_level(&error, level)) }
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue