4 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
VC
c6cdaa21b8 Merge branch 'useless_crate' into 'master'
refactor: remove useless crate:: ref

See merge request veretcle/scootaloo!18
2022-04-25 09:30:52 +00:00
VC
99a6adc1f4 refactor: remove useless crate:: ref 2022-04-25 11:27:11 +02:00
4 changed files with 11 additions and 12 deletions

2
Cargo.lock generated
View File

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

View File

@@ -1,6 +1,6 @@
[package]
name = "scootaloo"
version = "0.5.0"
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
}
}

View File

@@ -1,5 +1,5 @@
mod error;
use crate::error::ScootalooError;
use error::ScootalooError;
mod config;
use config::Config;