4 ms·
I've added a branch for this: https://github.com/joelonsql/wherr/tree/track_caller https://github.com/joelonsql/wherr/tree/track_caller `src/lib.rs` is your co
by JoelJacobson 3y ago
I've added a branch for this: https://github.com/joelonsql/wherr/tree/track_caller https://github.com/joelonsql/wherr/tree/track_caller
`src/lib.rs` is your code copy/pasted, with the addition of `impl<'a, E: StdError + 'a> From<E> for Box<dyn MyError + 'a>` like suggested (and also just `Send`).
I've also added a `fn inner_error<'a>(&'a self) -> &'a (dyn StdError + 'a);`, but not sure this is the proper way.
I can't wrap my head around how to match on the inner error though, see `examples/matching_inner.rs`:
match my_error_wrapped().unwrap_err() {
_ => todo!(),
}
Can you figure it out?