diff --git a/Cargo.lock b/Cargo.lock index c7ce4a120..361c053b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3593,7 +3593,6 @@ dependencies = [ name = "tor-config" version = "0.5.0" dependencies = [ - "anyhow", "config", "derive_builder_fork_arti", "directories", diff --git a/crates/tor-config/Cargo.toml b/crates/tor-config/Cargo.toml index 86294b84c..423645511 100644 --- a/crates/tor-config/Cargo.toml +++ b/crates/tor-config/Cargo.toml @@ -16,7 +16,6 @@ default = ["expand-paths"] expand-paths = ["shellexpand", "directories"] [dependencies] -anyhow = "1.0.23" config = { version = "0.13", default-features = false, features = ["toml"] } derive_builder = { version = "0.11.2", package = "derive_builder_fork_arti" } directories = { version = "4", optional = true } @@ -38,7 +37,6 @@ tor-error = { path = "../tor-error", version = "0.3.2" } tracing = "0.1.18" [dev-dependencies] -anyhow = "1.0.23" config = { version = "0.13", default-features = false, features = ["toml"] } dirs = "4.0.0" rmp-serde = "1" diff --git a/crates/tor-config/src/load.rs b/crates/tor-config/src/load.rs index 16cb47f65..4c8cacac5 100644 --- a/crates/tor-config/src/load.rs +++ b/crates/tor-config/src/load.rs @@ -43,7 +43,7 @@ //! but not recognized by *any* of the three config consumers, //! //! ``` -//! # fn main() -> Result<(), anyhow::Error> { +//! # fn main() -> Result<(), tor_config::load::ConfigResolveError> { //! use derive_builder::Builder; //! use tor_config::{impl_standard_builder, resolve, ConfigBuildError, ConfigurationSources}; //! use tor_config::load::TopLevel; diff --git a/crates/tor-config/src/sources.rs b/crates/tor-config/src/sources.rs index 6b9674f37..edcf6f054 100644 --- a/crates/tor-config/src/sources.rs +++ b/crates/tor-config/src/sources.rs @@ -243,11 +243,12 @@ impl ConfigurationSources { if e.kind() == io::ErrorKind::NotFound && !required { Result::<_, crate::ConfigError>::Ok(()) } else { - Err(foreign_err(anyhow::anyhow!(format!( + Err(config::ConfigError::Message(format!( "unable to access config path: {:?}: {}", &source.as_path(), e - )))) + )) + .into()) } };