From eff665a59aa5ce1efc59e567dadc91fef1ec0366 Mon Sep 17 00:00:00 2001 From: pml68 Date: Mon, 16 Jun 2025 00:27:57 +0200 Subject: feat: automatically save config updates --- src/error.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/error.rs') diff --git a/src/error.rs b/src/error.rs index 8c405b3..b98d678 100644 --- a/src/error.rs +++ b/src/error.rs @@ -7,13 +7,15 @@ use thiserror::Error; #[derive(Debug, Clone, Error)] #[error(transparent)] pub enum Error { - IO(Arc), + Io(Arc), #[error("Config file does not exist, so a default one was created")] ConfigMissing, #[error("JSON parsing error: {0}")] - SerdeJSON(Arc), + Json(Arc), #[error("TOML parsing error: {0}")] - SerdeTOML(#[from] toml::de::Error), + TomlDe(#[from] toml::de::Error), + #[error("TOML serialization error: {0}")] + TomlSer(#[from] toml::ser::Error), RustFmt(Arc), #[error("The element tree contains no matching element")] NonExistentElement, @@ -25,13 +27,13 @@ pub enum Error { impl From for Error { fn from(value: io::Error) -> Self { - Self::IO(Arc::new(value)) + Self::Io(Arc::new(value)) } } impl From for Error { fn from(value: serde_json::Error) -> Self { - Self::SerdeJSON(Arc::new(value)) + Self::Json(Arc::new(value)) } } -- cgit v1.2.3