use crate::error::ErrorImpl; use crate::EyreContext; use core::fmt; impl ErrorImpl<(), C> where C: EyreContext, { pub(crate) fn display(&self, f: &mut fmt::Formatter) -> fmt::Result { self.context .as_ref() .map(|context| context.display(self.error(), f)) .unwrap_or_else(|| std::fmt::Display::fmt(self.error(), f)) } pub(crate) fn debug(&self, f: &mut fmt::Formatter) -> fmt::Result { self.context .as_ref() .map(|context| context.debug(self.error(), f)) .unwrap_or_else(|| std::fmt::Debug::fmt(self.error(), f)) } }