зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1622256 - Remove deprecated Error::description and use Display trait instead. r=jgraham,webdriver-reviewers
Depends on D66765 Differential Revision: https://phabricator.services.mozilla.com/D66766 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
763458cb65
Коммит
b94a7e4f32
|
@ -89,21 +89,17 @@ pub enum RunnerError {
|
|||
|
||||
impl fmt::Display for RunnerError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
self.description().fmt(f)
|
||||
match *self {
|
||||
RunnerError::Io(ref err) => match err.kind() {
|
||||
ErrorKind::NotFound => "no such file or directory".fmt(f),
|
||||
_ => err.fmt(f),
|
||||
}
|
||||
RunnerError::PrefReader(ref err) => err.fmt(f),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Error for RunnerError {
|
||||
fn description(&self) -> &str {
|
||||
match *self {
|
||||
RunnerError::Io(ref err) => match err.kind() {
|
||||
ErrorKind::NotFound => "no such file or directory",
|
||||
_ => err.description(),
|
||||
},
|
||||
RunnerError::PrefReader(ref err) => err.description(),
|
||||
}
|
||||
}
|
||||
|
||||
fn cause(&self) -> Option<&dyn Error> {
|
||||
Some(match *self {
|
||||
RunnerError::Io(ref err) => err as &dyn Error,
|
||||
|
|
Загрузка…
Ссылка в новой задаче