mirror of
https://framagit.org/veretcle/scootaloo.git
synced 2025-07-21 17:34:37 +02:00
Merge branch 'refactor_error' into 'master'
refactor(error): remove deprecated description() See merge request veretcle/scootaloo!19
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -2016,7 +2016,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "scootaloo"
|
name = "scootaloo"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap",
|
"clap",
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "scootaloo"
|
name = "scootaloo"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
authors = ["VC <veretcle+framagit@mateu.be>"]
|
authors = ["VC <veretcle+framagit@mateu.be>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
|
17
src/error.rs
17
src/error.rs
@@ -1,4 +1,7 @@
|
|||||||
use std::fmt;
|
use std::{
|
||||||
|
fmt::{Display, Formatter, Result},
|
||||||
|
error::Error,
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct ScootalooError {
|
pub struct ScootalooError {
|
||||||
@@ -13,15 +16,11 @@ impl ScootalooError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for ScootalooError {
|
impl Error for ScootalooError {}
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
||||||
|
impl Display for ScootalooError {
|
||||||
|
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||||
write!(f, "{}", self.details)
|
write!(f, "{}", self.details)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::error::Error for ScootalooError {
|
|
||||||
fn description(&self) -> &str {
|
|
||||||
&self.details
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user