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:
Kartikaya Gupta 2020-03-14 04:21:22 +00:00
Родитель 763458cb65
Коммит b94a7e4f32
1 изменённых файлов: 7 добавлений и 11 удалений

Просмотреть файл

@ -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,