diff options
author | Daniel Schadt <kingdread@gmx.de> | 2020-04-04 13:48:56 +0200 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2020-04-04 13:55:20 +0200 |
commit | 4ec62bbac872bbfd95413af2f00c3f4a36c70630 (patch) | |
tree | 22cac1ff6f9776565d9f35322c463ec6125c0bc7 /src/statistics/mod.rs | |
parent | 22738da2cd36b4ae2e1fb5efd23373e6b77405a2 (diff) | |
download | evtclib-4ec62bbac872bbfd95413af2f00c3f4a36c70630.tar.gz evtclib-4ec62bbac872bbfd95413af2f00c3f4a36c70630.tar.bz2 evtclib-4ec62bbac872bbfd95413af2f00c3f4a36c70630.zip |
switch from quick_error to thiserror
thiserror seems to be the more modern approach that also works with the
new Error trait from std.
Diffstat (limited to 'src/statistics/mod.rs')
-rw-r--r-- | src/statistics/mod.rs | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/statistics/mod.rs b/src/statistics/mod.rs index eccc3ee..3e42d9c 100644 --- a/src/statistics/mod.rs +++ b/src/statistics/mod.rs @@ -1,7 +1,7 @@ //! This module aids in the creation of actual boss statistics. use super::*; use std::collections::HashMap; -use std::error::Error; +use thiserror::Error; pub mod boon; pub mod damage; @@ -17,15 +17,10 @@ use self::trackers::{RunnableTracker, Tracker}; pub type StatResult<T> = Result<T, StatError>; -quick_error! { - #[derive(Debug)] - pub enum StatError { - TrackerError(err: Box<dyn Error>) { - description("tracker error") - display("tracker returned an error: {}", err) - cause(&**err) - } - } +#[derive(Error, Debug)] +pub enum StatError { + #[error("tracker returned an error: {0}")] + TrackerError(#[from] Box<dyn std::error::Error>), } macro_rules! try_tracker { |