Merge branch 'refactor-anyhow-arti-crate' into 'main'
Remove `anyhow` from `tor-config` crate See merge request tpo/core/arti!707
This commit is contained in:
commit
8d6a1ea6ec
|
@ -3593,7 +3593,6 @@ dependencies = [
|
|||
name = "tor-config"
|
||||
version = "0.5.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"config",
|
||||
"derive_builder_fork_arti",
|
||||
"directories",
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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())
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue