Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: wrap io::Error in Arc for clone #2181

Merged
merged 1 commit into from
Apr 14, 2024
Merged

Commits on Apr 13, 2024

  1. error: wrap io::Error in Arc for clone

    `ProtoErrorKind` is `Clone`, but the `Io` variant holding `io:Error`
    runs into trouble with this: since the error can't be cloned we have to
    reconstruct it and this is a lossy process: resulting in a "simple"
    `io::Error` that only holds the error type from the parent it was cloned
    from. This loses important details like the underlying error
    source/message.
    
    This commit changes `ProtoErrorKind::Io` to hold `Arc<io::Error>>`
    instead. This makes implementing `Clone` trivial - we clone the arc
    - and no error information is lost.
    cpu committed Apr 13, 2024
    Configuration menu
    Copy the full SHA
    c6473dd View commit details
    Browse the repository at this point in the history