Fix BinstallError::CrateContext: Forward diagnostics of field CrateContextError::err (#586)

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-12-03 23:12:04 +11:00 committed by GitHub
parent a69db83aa6
commit 887ebb6f6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,11 +32,12 @@ pub struct VersionParseError {
pub err: semver::Error,
}
#[derive(Debug, Error)]
#[derive(Debug, Diagnostic, Error)]
#[error("For crate {crate_name}: {err}")]
pub struct CrateContextError {
crate_name: CompactString,
#[source]
#[diagnostic(transparent)]
err: BinstallError,
}
@ -292,6 +293,7 @@ pub enum BinstallError {
/// A wrapped error providing the context of which crate the error is about.
#[error(transparent)]
#[diagnostic(transparent)]
CrateContext(Box<CrateContextError>),
}