diff --git a/src/config/mod.rs b/src/config/mod.rs index f0b2f94..bb6850b 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -24,6 +24,9 @@ pub struct Config { /// If true, print to std{out/err} pub verbose: bool, + + /// Path to implementation config file + pub impl_path: Option, } impl Default for Config { @@ -34,6 +37,7 @@ impl Default for Config { accounts_path: "accounts".into(), map: "map.toml".into(), verbose: true, + impl_path: None, } } } diff --git a/src/error.rs b/src/error.rs index 0804b58..6db1382 100644 --- a/src/error.rs +++ b/src/error.rs @@ -2,7 +2,8 @@ use std::{fmt, path::PathBuf}; -/// Error struct +/// Error enum, which acts as different Error structs wrapper, +/// while also handling some other errors #[derive(Debug)] #[non_exhaustive] pub enum Error { @@ -19,10 +20,10 @@ pub enum Error { impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Error::IsNotAFile(path) => write!(f, "{:?} is not a file", path), - Error::IoError(error) => write!(f, "io error: {error}"), - Error::TomlSerializeError(error) => write!(f, "serialize error: {error}"), - Error::TomlDeserializeError(error) => write!(f, "parse error: {error}") + Self::IsNotAFile(path) => write!(f, "{path:?} is not a file"), + Self::IoError(error) => write!(f, "{error}"), + Self::TomlSerializeError(error) => write!(f, "{error}"), + Self::TomlDeserializeError(error) => write!(f, "{error}"), } } }