Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd `Clone` + `PartialEq` traits to `bincode::ErrorKind` #273
Conversation
|
It's not clear to me why the 1.18 build for Travis CI is failing. I'm also not thrilled by the idea of a PartialEq implementation that lies about Io errors |
|
It's difficult to decide between ways of handling errors, and creating large Rust projects that can propagate errors of any type. Happy to make changes to get it approved by you. Tell us what to do. FYI: That IO line is same as https://github.com/spacejam/sled/blob/3b20bf4/crates/pagecache/src/result.rs#L103 |
|
Unless there is a stronger motivation for PartialEq than writing tests, I would prefer not to include that change. |
|
I would prefer to pass on the Clone impl as well. In code that needs multiple owned values of the same error, it should use Rc<bincode::Error> or similar. As an advantage over the impl in this PR, that approach preserves the cause of the io error. It would be surprising for Clone to produce an error that behaves differently from the original. |
SamuelMarks commentedJul 22, 2019
Add
Clonetrait forbincode::ErrorKind. Also addPartialEqtrait to allow useassert_eq!in tests.