2 Commits

Author SHA1 Message Date
VC
dab8725f99 Merge branch 'refactor_error' into 'master'
refactor(error): remove deprecated description()

See merge request veretcle/scootaloo!19
2022-05-03 10:17:37 +00:00
VC
08368b2a73 refactor(error): remove deprecated description() 2022-05-03 12:14:23 +02:00
3 changed files with 10 additions and 11 deletions

2
Cargo.lock generated
View File

@@ -2016,7 +2016,7 @@ dependencies = [
[[package]]
name = "scootaloo"
version = "0.5.1"
version = "0.5.2"
dependencies = [
"chrono",
"clap",

View File

@@ -1,6 +1,6 @@
[package]
name = "scootaloo"
version = "0.5.1"
version = "0.5.2"
authors = ["VC <veretcle+framagit@mateu.be>"]
edition = "2021"

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
}
}