Loading crates/arti-client/src/config.rs +6 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ use std::collections::HashMap; use std::path::Path; use std::path::PathBuf; use std::time::Duration; pub use tor_config::{CfgPath, ConfigBuildError, Reconfigure}; pub use tor_config::{CfgPath, CfgPathError, ConfigBuildError, Reconfigure}; /// Types for configuring how Tor circuits are built. pub mod circ { Loading Loading @@ -370,6 +370,11 @@ pub(crate) fn default_fs_mistrust() -> fs_mistrust::Mistrust { mistrust } /// Return a filename for the default user configuration file. pub fn default_config_file() -> Result<PathBuf, CfgPathError> { CfgPath::new("${ARTI_CONFIG}/arti.toml".into()).path() } #[cfg(test)] mod test { #![allow(clippy::unwrap_used)] Loading crates/arti-config/src/lib.rs +1 −6 Original line number Diff line number Diff line Loading @@ -52,7 +52,6 @@ mod options; pub use cmdline::CmdLine; pub use options::ARTI_DEFAULTS; use tor_config::{CfgPath, CfgPathError}; /// The synchronous configuration builder type we use. /// Loading Loading @@ -207,15 +206,11 @@ where builder } /// Return a filename for the default user configuration file. pub fn default_config_file() -> Result<PathBuf, CfgPathError> { CfgPath::new("${ARTI_CONFIG}/arti.toml".into()).path() } #[cfg(test)] mod test { #![allow(clippy::unwrap_used)] use super::*; use arti_client::config::default_config_file; use tempfile::tempdir; static EX_TOML: &str = " Loading crates/arti/src/lib.rs +2 −2 Original line number Diff line number Diff line Loading @@ -128,8 +128,8 @@ pub use cfg::{ }; pub use logging::{LoggingConfig, LoggingConfigBuilder}; use arti_client::config::default_config_file; use arti_client::{TorClient, TorClientConfig}; use arti_config::default_config_file; use safelog::with_safe_logging_suppressed; use tor_rtcompat::{BlockOn, Runtime}; Loading Loading @@ -263,7 +263,7 @@ pub fn main_main() -> Result<()> { // correct behavior is different depending on whether the filename is given // explicitly or not. let mut config_file_help = "Specify which config file(s) to read.".to_string(); if let Ok(default) = arti_config::default_config_file() { if let Ok(default) = default_config_file() { // If we couldn't resolve the default config file, then too bad. If something // actually tries to use it, it will produce an error, but don't fail here // just for that reason. Loading Loading
crates/arti-client/src/config.rs +6 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ use std::collections::HashMap; use std::path::Path; use std::path::PathBuf; use std::time::Duration; pub use tor_config::{CfgPath, ConfigBuildError, Reconfigure}; pub use tor_config::{CfgPath, CfgPathError, ConfigBuildError, Reconfigure}; /// Types for configuring how Tor circuits are built. pub mod circ { Loading Loading @@ -370,6 +370,11 @@ pub(crate) fn default_fs_mistrust() -> fs_mistrust::Mistrust { mistrust } /// Return a filename for the default user configuration file. pub fn default_config_file() -> Result<PathBuf, CfgPathError> { CfgPath::new("${ARTI_CONFIG}/arti.toml".into()).path() } #[cfg(test)] mod test { #![allow(clippy::unwrap_used)] Loading
crates/arti-config/src/lib.rs +1 −6 Original line number Diff line number Diff line Loading @@ -52,7 +52,6 @@ mod options; pub use cmdline::CmdLine; pub use options::ARTI_DEFAULTS; use tor_config::{CfgPath, CfgPathError}; /// The synchronous configuration builder type we use. /// Loading Loading @@ -207,15 +206,11 @@ where builder } /// Return a filename for the default user configuration file. pub fn default_config_file() -> Result<PathBuf, CfgPathError> { CfgPath::new("${ARTI_CONFIG}/arti.toml".into()).path() } #[cfg(test)] mod test { #![allow(clippy::unwrap_used)] use super::*; use arti_client::config::default_config_file; use tempfile::tempdir; static EX_TOML: &str = " Loading
crates/arti/src/lib.rs +2 −2 Original line number Diff line number Diff line Loading @@ -128,8 +128,8 @@ pub use cfg::{ }; pub use logging::{LoggingConfig, LoggingConfigBuilder}; use arti_client::config::default_config_file; use arti_client::{TorClient, TorClientConfig}; use arti_config::default_config_file; use safelog::with_safe_logging_suppressed; use tor_rtcompat::{BlockOn, Runtime}; Loading Loading @@ -263,7 +263,7 @@ pub fn main_main() -> Result<()> { // correct behavior is different depending on whether the filename is given // explicitly or not. let mut config_file_help = "Specify which config file(s) to read.".to_string(); if let Ok(default) = arti_config::default_config_file() { if let Ok(default) = default_config_file() { // If we couldn't resolve the default config file, then too bad. If something // actually tries to use it, it will produce an error, but don't fail here // just for that reason. Loading