diff --git a/dev-tools/omicron-dev/src/bin/omicron-dev.rs b/dev-tools/omicron-dev/src/bin/omicron-dev.rs index 3caa11fdd9..0ab4987f0a 100644 --- a/dev-tools/omicron-dev/src/bin/omicron-dev.rs +++ b/dev-tools/omicron-dev/src/bin/omicron-dev.rs @@ -4,7 +4,7 @@ //! Developer tool for easily running bits of Omicron -use anyhow::{anyhow, bail, Context}; +use anyhow::{bail, Context}; use camino::Utf8Path; use camino::Utf8PathBuf; use clap::Args; @@ -33,7 +33,7 @@ async fn main() -> Result<(), anyhow::Error> { OmicronDb::CertCreate { ref args } => cmd_cert_create(args).await, }; if let Err(error) = result { - fatal(CmdError::Failure(anyhow!(error))); + fatal(CmdError::Failure(error)); } Ok(()) } diff --git a/sled-agent/src/bin/sled-agent-sim.rs b/sled-agent/src/bin/sled-agent-sim.rs index 13146b0060..ee0ebda71e 100644 --- a/sled-agent/src/bin/sled-agent-sim.rs +++ b/sled-agent/src/bin/sled-agent-sim.rs @@ -125,10 +125,10 @@ async fn do_run() -> Result<(), CmdError> { (Some(cert_path), Some(key_path)) => { let cert_bytes = std::fs::read_to_string(&cert_path) .with_context(|| format!("read {:?}", &cert_path)) - .map_err(|e| CmdError::Failure(anyhow!(e)))?; + .map_err(CmdError::Failure)?; let key_bytes = std::fs::read_to_string(&key_path) .with_context(|| format!("read {:?}", &key_path)) - .map_err(|e| CmdError::Failure(anyhow!(e)))?; + .map_err(CmdError::Failure)?; Some(NexusTypes::Certificate { cert: cert_bytes, key: key_bytes }) } _ => { @@ -145,7 +145,5 @@ async fn do_run() -> Result<(), CmdError> { tls_certificate, }; - run_standalone_server(&config, &rss_args) - .await - .map_err(|e| CmdError::Failure(anyhow!(e))) + run_standalone_server(&config, &rss_args).await.map_err(CmdError::Failure) } diff --git a/sp-sim/src/bin/sp-sim.rs b/sp-sim/src/bin/sp-sim.rs index 85950c9f88..ee0dd3b70c 100644 --- a/sp-sim/src/bin/sp-sim.rs +++ b/sp-sim/src/bin/sp-sim.rs @@ -29,12 +29,10 @@ async fn do_run() -> Result<(), CmdError> { let config = Config::from_file(args.config_file_path) .map_err(|e| CmdError::Failure(anyhow!(e)))?; - let log = - sp_sim::logger(&config).map_err(|e| CmdError::Failure(anyhow!(e)))?; + let log = sp_sim::logger(&config).map_err(CmdError::Failure)?; - let _rack = SimRack::start(&config, &log) - .await - .map_err(|e| CmdError::Failure(anyhow!(e)))?; + let _rack = + SimRack::start(&config, &log).await.map_err(CmdError::Failure)?; // for now, do nothing except let the spawned tasks run. in the future // (or when used as a library), the expectation is that a caller can diff --git a/wicketd/src/bin/wicketd.rs b/wicketd/src/bin/wicketd.rs index f3ad23f135..887ac496e0 100644 --- a/wicketd/src/bin/wicketd.rs +++ b/wicketd/src/bin/wicketd.rs @@ -113,7 +113,7 @@ async fn do_run() -> Result<(), CmdError> { Some(addr) => Some(Ipv6Subnet::new(addr)), None if read_smf_config => { let smf_values = SmfConfigValues::read_current() - .map_err(|e| CmdError::Failure(anyhow!(e)))?; + .map_err(CmdError::Failure)?; smf_values.rack_subnet } None => None,