Added ToCString variant to Error.source()

This commit is contained in:
Josh Mitchell
2020-11-09 22:40:37 +11:00
parent f757072523
commit 9ac3c959d9

View File

@@ -126,6 +126,8 @@ impl std::error::Error for Error {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
if let Some(e) = &self.code {
Some(e)
} else if let ErrorTask::ToCString(Some(e)) = &self.task {
Some(e)
} else {
None
}