Skip to content

Commit

Permalink
Remove useless conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
papertigers committed Nov 6, 2023
1 parent b00b142 commit 84537ae
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions dev-tools/omicron-dev/src/bin/omicron-dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(())
}
Expand Down
8 changes: 3 additions & 5 deletions sled-agent/src/bin/sled-agent-sim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}
_ => {
Expand All @@ -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)
}
8 changes: 3 additions & 5 deletions sp-sim/src/bin/sp-sim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion wicketd/src/bin/wicketd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 84537ae

Please sign in to comment.