Skip to content

Commit

Permalink
Merge branch 'main' into checked-and-unchecked-tryfrom-msg
Browse files Browse the repository at this point in the history
  • Loading branch information
TTWNO authored Nov 20, 2024
2 parents cb70e23 + 14e3995 commit c62808c
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 24 deletions.
2 changes: 1 addition & 1 deletion atspi-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "atspi-common"
version = "0.6.0"
version = "0.8.0"
edition = "2021"
readme = "README.md"
categories = ["accessibility", "api-bindings"]
Expand Down
52 changes: 41 additions & 11 deletions atspi-common/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,34 +77,61 @@ impl std::fmt::Display for AtspiError {
match self {
Self::Conversion(e) => f.write_str(&format!("atspi: conversion failure: {e}")),
Self::MemberMatch(e) => {
f.write_str(format!("atspi: member mismatch in conversion: {e}").as_str())
f.write_str("atspi: member mismatch in conversion: ")?;
e.fmt(f)
}
Self::InterfaceMatch(e) => {
f.write_str(format!("atspi: interface mismatch in conversion: {e}").as_str())
f.write_str("atspi: interface mismatch in conversion: ")?;
e.fmt(f)
}
Self::KindMatch(e) => {
f.write_str(format!("atspi: kind mismatch in conversion: {e}").as_str())
}
Self::SignatureMatch(e) => {
f.write_str(format!("atspi: body signature mismatch in conversion: {e:?}").as_str())
Self::UnknownBusSignature(e) => {
f.write_str("atspi: Unknown bus body signature: ")?;
e.fmt(f)
}
Self::UnknownInterface => f.write_str("Unknown interface."),
Self::MissingInterface => f.write_str("Missing interface."),
Self::MissingMember => f.write_str("Missing member."),
Self::MissingSignature => f.write_str("Missing signature."),
Self::UnknownRole(e) => f.write_str(&format!("atspi: Unknown role: {e}")),
Self::UnknownRole(e) => {
f.write_str("atspi: Unknown role: ")?;
e.fmt(f)
}
Self::UnknownSignal => f.write_str("atspi: Unknown signal"),
Self::CacheVariantMismatch => f.write_str("atspi: Cache variant mismatch"),
Self::Owned(e) => f.write_str(&format!("atspi: other error: {e}")),
Self::Zbus(e) => f.write_str(&format!("ZBus Error: {e}")),
Self::Zvariant(e) => f.write_str(&format!("Zvariant error: {e}")),
Self::ZBusNames(e) => f.write_str(&format!("ZBus_names Error: {e}")),
Self::Owned(e) => {
f.write_str("atspi: other error: ")?;
e.fmt(f)
}
Self::Zbus(e) => {
f.write_str("ZBus Error: ")?;
e.fmt(f)
}
Self::Zvariant(e) => {
f.write_str("Zvariant error: ")?;
e.fmt(f)
}
Self::ZBusNames(e) => {
f.write_str("ZBus_names Error: ")?;
e.fmt(f)
}
Self::ParseError(e) => f.write_str(e),
Self::PathConversionError(e) => {
f.write_str(&format!("ID cannot be extracted from the path: {e}"))
f.write_str("ID cannot be extracted from the path: ")?;
e.fmt(f)
}
Self::IO(e) => {
f.write_str("std IO Error: ")?;
e.fmt(f)
}
Self::IntConversionError(e) => {
f.write_str("Integer conversion error: ")?;
e.fmt(f)
}
Self::IO(e) => f.write_str(&format!("std IO Error: {e}")),
Self::IntConversionError(e) => f.write_str(&format!("Integer conversion error: {e}")),
Self::MissingName => f.write_str("Missing name for a bus."),
Self::Infallible => {
f.write_str("Infallible; only to trick the compiler. This should never happen.")
Expand Down Expand Up @@ -172,7 +199,10 @@ impl std::fmt::Display for ObjectPathConversionError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::NoIdAvailable => f.write_str("No ID available in the path."),
Self::ParseError(e) => f.write_str(&format!("Failure to parse: {e}")),
Self::ParseError(e) => {
f.write_str("Failure to parse: {e}")?;
e.fmt(f)
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion atspi-common/src/role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ impl Role {

impl std::fmt::Display for Role {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.name())
f.write_str(self.name())
}
}

Expand Down
8 changes: 4 additions & 4 deletions atspi-connection/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "atspi-connection"
version = "0.6.0"
version = "0.8.0"
edition = "2021"
description = "A method of connecting, querying, sending and receiving over AT-SPI."
license = "Apache-2.0 OR MIT"
keywords = ["screen-reader", "accessibility", "a11y", "linux"]
categories = ["accessibility", "API bindings"]
categories = ["accessibility"]
rust-version.workspace = true
repository = "https://github.com/odilia-app/atspi/"
readme = "README.md"
Expand All @@ -20,8 +20,8 @@ async-std = ["zbus/async-io", "atspi-proxies/async-std", "atspi-common/async-std
tokio = ["zbus/tokio", "atspi-proxies/tokio", "atspi-common/tokio"]

[dependencies]
atspi-common = { path = "../atspi-common/", version = "0.6.0", default-features = false }
atspi-proxies = { path = "../atspi-proxies/", version = "0.6.0", default-features = false }
atspi-common = { path = "../atspi-common/", version = "0.8.0", default-features = false }
atspi-proxies = { path = "../atspi-proxies/", version = "0.8.0", default-features = false }
futures-lite = { version = "2", default-features = false }
tracing = { optional = true, workspace = true }
zbus.workspace = true
Expand Down
6 changes: 3 additions & 3 deletions atspi-proxies/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "atspi-proxies"
version = "0.6.0"
version = "0.8.0"
description = "AT-SPI2 proxies to query or manipulate UI objects"
license = "Apache-2.0 OR MIT"
readme = "README.md"
Expand All @@ -23,14 +23,14 @@ gvariant = ["zvariant/gvariant"]
tokio = ["zbus/tokio", "atspi-common/tokio"]

[dependencies]
atspi-common = { path = "../atspi-common", version = "0.6.0", default-features = false }
atspi-common = { path = "../atspi-common", version = "0.8.0", default-features = false }
serde = { version = "^1.0", default-features = false, features = ["derive"] }
zbus = { workspace = true }
zvariant = { version = "4.1", default-features = false }

[dev-dependencies]
async-std = { version = "1", features = ["attributes"] }
atspi-common = { path = "../atspi-common", version = "0.6.0", features = ["async-std"] }
atspi-common = { path = "../atspi-common", version = "0.8.0", features = ["async-std"] }
byteorder = "1.4"
futures-lite = { version = "2", default-features = false }
rename-item = "0.1.0"
Expand Down
8 changes: 4 additions & 4 deletions atspi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "atspi"
version = "0.22.0"
version = "0.24.0"
authors.workspace = true
edition = "2021"
description = "Pure-Rust, zbus-based AT-SPI2 protocol implementation."
Expand Down Expand Up @@ -29,9 +29,9 @@ connection-tokio = ["atspi-connection/tokio", "connection"]
tracing = ["atspi-connection/tracing"]

[dependencies]
atspi-common = { path = "../atspi-common", version = "0.6.0", default-features = false }
atspi-connection = { path = "../atspi-connection", version = "0.6.0", default-features = false, optional = true }
atspi-proxies = { path = "../atspi-proxies", version = "0.6.0", default-features = false, optional = true }
atspi-common = { path = "../atspi-common", version = "0.8.0", default-features = false }
atspi-connection = { path = "../atspi-connection", version = "0.8.0", default-features = false, optional = true }
atspi-proxies = { path = "../atspi-proxies", version = "0.8.0", default-features = false, optional = true }
zbus = { workspace = true, default-features = false, optional = true }

[[bench]]
Expand Down

0 comments on commit c62808c

Please sign in to comment.