refactor(error): remove deprecated description()

This commit is contained in:
VC
2022-05-03 12:14:23 +02:00
parent c6cdaa21b8
commit 08368b2a73
3 changed files with 10 additions and 11 deletions

View File

@@ -1,4 +1,7 @@
use std::fmt;
use std::{
fmt::{Display, Formatter, Result},
error::Error,
};
#[derive(Debug)]
pub struct ScootalooError {
@@ -13,15 +16,11 @@ impl ScootalooError {
}
}
impl fmt::Display for ScootalooError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
impl Error for ScootalooError {}
impl Display for ScootalooError {
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f, "{}", self.details)
}
}
impl std::error::Error for ScootalooError {
fn description(&self) -> &str {
&self.details
}
}