use std::fmt::Display;
pub trait MoreInfo {
#[track_caller]
fn err_log(self) -> Self;
}
impl<T, E: Display> MoreInfo for Result<T, E> {
#[track_caller]
fn err_log(self) -> Self {
if let Err(ref e) = self {
let loc = std::panic::Location::caller();
println!("Error: {e} at file: {} line: {}", loc.file(), loc.line())
}
self
}
}