diff --git a/Cargo.lock b/Cargo.lock index 85922cd8..156bbc0b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,7 +46,6 @@ dependencies = [ "accesskit_consumer", "atspi-common", "serde", - "thiserror", "zvariant", ] diff --git a/platforms/atspi-common/Cargo.toml b/platforms/atspi-common/Cargo.toml index 88f5cd5e..4767c690 100644 --- a/platforms/atspi-common/Cargo.toml +++ b/platforms/atspi-common/Cargo.toml @@ -19,6 +19,5 @@ accesskit = { version = "0.21.1", path = "../../common" } accesskit_consumer = { version = "0.31.0", path = "../../consumer" } atspi-common = { version = "0.9", default-features = false } serde = "1.0" -thiserror = "1.0" zvariant = { version = "5.4", default-features = false } diff --git a/platforms/atspi-common/src/error.rs b/platforms/atspi-common/src/error.rs index 9fff5927..b6129032 100644 --- a/platforms/atspi-common/src/error.rs +++ b/platforms/atspi-common/src/error.rs @@ -3,20 +3,31 @@ // the LICENSE-APACHE file) or the MIT license (found in // the LICENSE-MIT file), at your option. -#[derive(Debug, thiserror::Error)] +use std::fmt; + +#[derive(Debug)] pub enum Error { - #[error("defunct")] Defunct, - #[error("unsupported interface")] UnsupportedInterface, - #[error("too many children")] TooManyChildren, - #[error("index out of range")] IndexOutOfRange, - #[error("too many characters")] TooManyCharacters, - #[error("unsupported text granularity")] UnsupportedTextGranularity, } +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(match self { + Self::Defunct => "defunct", + Self::UnsupportedInterface => "unsupported interface", + Self::TooManyChildren => "too many children", + Self::IndexOutOfRange => "index out of range", + Self::TooManyCharacters => "too many characters", + Self::UnsupportedTextGranularity => "unsupported text granularity", + }) + } +} + +impl std::error::Error for Error {} + pub type Result = std::result::Result;