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

Implement Error::source when supported #1768

Closed
seanmonstar opened this issue Feb 27, 2019 · 1 comment
Closed

Implement Error::source when supported #1768

seanmonstar opened this issue Feb 27, 2019 · 1 comment
Labels
A-error Area: error handling C-feature Category: feature. This is adding a new feature. E-easy Effort: easy. A task that would be a great starting point for a new contributor.

Comments

@seanmonstar
Copy link
Member

The source method is the better replacement for cause. Hyper's Error should implement the method.

However, it's only available on newer Rust versions. To prevent requiring a new version, a build script can check rustc --version and set a cfg flag such that it's only implemented when available.

@seanmonstar seanmonstar added E-easy Effort: easy. A task that would be a great starting point for a new contributor. C-feature Category: feature. This is adding a new feature. A-error Area: error handling labels Feb 27, 2019
@sfackler
Copy link
Contributor

The rustc_version crate can handle the heavy lifting in the build script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-error Area: error handling C-feature Category: feature. This is adding a new feature. E-easy Effort: easy. A task that would be a great starting point for a new contributor.
Projects
None yet
Development

No branches or pull requests

2 participants