mirror of
https://github.com/facebook/sapling.git
synced 2024-12-29 08:02:24 +03:00
9c6f253858
Summary: This diff replaces code of the form: ``` use failure::Fail; #[derive(Fail, Debug)] pub enum ErrorKind { #[fail(display = "something failed {} times", _0)] Failed(usize), } ``` with: ``` use thiserror::Error; #[derive(Error, Debug)] pub enum ErrorKind { #[error("something failed {0} times")] Failed(usize), } ``` The former emits an implementation of failure 0.1's `Fail` trait while the latter emits an impl of `std::error::Error`. Failure provides a blanket impl of `Fail` for any type that implements `Error`, so these `Error` impls are strictly more general. Each of these error types will continue to have exactly the same `Fail` impl that it did before this change, but now also has the appropriate `std::error::Error` impl which sets us up for dropping our various dependencies on `Fail` throughout the codebase. Reviewed By: Imxset21 Differential Revision: D18523700 fbshipit-source-id: 0e43b10d5dfa79820663212391ecbf4aeaac2d41 |
||
---|---|---|
.. | ||
hgmain | ||
scm_daemon | ||
scratch | ||
utils |