Last active
June 15, 2024 12:00
-
-
Save loverdos/c15f1ecc6d242f30d64ea1e220b96cc5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::error::Error; | |
pub fn do_error_source<F>(source_opt: Option<&dyn Error>, f: F) | |
where | |
F: Fn(&dyn Error), | |
{ | |
match source_opt { | |
None => {} | |
Some(source) => { | |
f(source); | |
do_error_source(source.source(), f); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment