1 2 3 4 5 6 7 8 9 10 11 12 13 14
/* use std::error::Error; pub(crate) fn find<'a, E: Error + 'static>(top: &'a (dyn Error + 'static)) -> Option<&'a E> { let mut err = Some(top); while let Some(src) = err { if src.is::<E>() { return src.downcast_ref(); } err = src.source(); } None } */