Seeker14491 / opener

Open a file or link in the system default program.
Apache License 2.0
49 stars 10 forks source link

Switch OpenError to use std Error trait instead of deriving Fail #3

Closed LPGhatguy closed 5 years ago

LPGhatguy commented 5 years ago

Closes #2.

This PR makes OpenError implement std::error::Error, which I think is expected of most error types. It will help make opener easier to use in projects that don't use the failure crate.

Since failure was only used for setting the source of the OpenError, this is a pretty straightforward change.

This should not be a breaking change since failure already blanket implements the Fail trait for everything implementing std::error::Error.

This change may increase the minimum Rust version that opener requires, since Error::source was only stabilized in Rust 1.30. If this is a problem, I can change the PR to use the (now deprecated) Error::cause API which is functionally very similar.

This removes the explicit dependencies on failure and failure_derive, which should improve compilation times for consumers of opener that aren't otherwise using those libraries.