From f2a4fe5096c217d8c44fe43296565df9d99605cb Mon Sep 17 00:00:00 2001 From: Michael Zeller Date: Mon, 6 Nov 2023 13:07:55 -0500 Subject: [PATCH] Apply jgallagher suggestions from code review Co-authored-by: John Gallagher --- gateway/src/bin/mgs.rs | 4 ++-- oximeter/collector/src/bin/oximeter.rs | 2 +- sled-agent/src/bin/sled-agent.rs | 6 +++--- wicketd/src/bin/wicketd.rs | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gateway/src/bin/mgs.rs b/gateway/src/bin/mgs.rs index 8754c26c30..b83578b384 100644 --- a/gateway/src/bin/mgs.rs +++ b/gateway/src/bin/mgs.rs @@ -72,7 +72,7 @@ async fn do_run() -> Result<(), CmdError> { match args { Args::Openapi => { - run_openapi().map_err(|e| CmdError::Failure(anyhow!("{e}"))) + run_openapi().map_err(|e| CmdError::Failure(anyhow!(e))) } Args::Run { config_file_path, @@ -125,7 +125,7 @@ async fn do_run() -> Result<(), CmdError> { _ => unreachable!("invalid signal: {signal:?}"), }, result = server.wait_for_finish() => { - return result.map_err(|err| CmdError::Failure(anyhow!("{err}"))) + return result.map_err(|err| CmdError::Failure(anyhow!(err))) } } } diff --git a/oximeter/collector/src/bin/oximeter.rs b/oximeter/collector/src/bin/oximeter.rs index 5eb666fcd0..d97ae5e72e 100644 --- a/oximeter/collector/src/bin/oximeter.rs +++ b/oximeter/collector/src/bin/oximeter.rs @@ -134,7 +134,7 @@ async fn do_run() -> Result<(), CmdError> { let args = Args::parse(); match args { Args::Openapi => { - run_openapi().map_err(|err| CmdError::Failure(anyhow!("{err}"))) + run_openapi().map_err(|err| CmdError::Failure(anyhow!(err))) } Args::Run { config_file, id, address } => { let config = Config::from_file(config_file).unwrap(); diff --git a/sled-agent/src/bin/sled-agent.rs b/sled-agent/src/bin/sled-agent.rs index 0843484900..f4d654c2c1 100644 --- a/sled-agent/src/bin/sled-agent.rs +++ b/sled-agent/src/bin/sled-agent.rs @@ -53,9 +53,9 @@ async fn do_run() -> Result<(), CmdError> { match args { Args::Openapi(flavor) => match flavor { OpenapiFlavor::Sled => sled_server::run_openapi() - .map_err(|err| CmdError::Failure(anyhow!("{err}"))), + .map_err(|err| CmdError::Failure(anyhow!(err))), OpenapiFlavor::Bootstrap => bootstrap_server::run_openapi() - .map_err(|err| CmdError::Failure(anyhow!("{err}"))), + .map_err(|err| CmdError::Failure(anyhow!(err))), }, Args::Run { config_path } => { let config = SledConfig::from_file(&config_path) @@ -110,7 +110,7 @@ async fn do_run() -> Result<(), CmdError> { server .wait_for_finish() .await - .map_err(|err| CmdError::Failure(anyhow!("{err}")))?; + .map_err(|err| CmdError::Failure(anyhow!(err)))?; Ok(()) } diff --git a/wicketd/src/bin/wicketd.rs b/wicketd/src/bin/wicketd.rs index c615ae3da4..c4687f828c 100644 --- a/wicketd/src/bin/wicketd.rs +++ b/wicketd/src/bin/wicketd.rs @@ -71,7 +71,7 @@ async fn do_run() -> Result<(), CmdError> { match args { Args::Openapi => { - run_openapi().map_err(|err| CmdError::Failure(anyhow!("{err}"))) + run_openapi().map_err(|err| CmdError::Failure(anyhow!(err))) } Args::Run { config_file_path, @@ -134,11 +134,11 @@ async fn do_run() -> Result<(), CmdError> { .map_err(CmdError::Failure)?; let server = Server::start(log, args) .await - .map_err(|err| CmdError::Failure(anyhow!("{err}")))?; + .map_err(|err| CmdError::Failure(anyhow!(err)))?; server .wait_for_finish() .await - .map_err(|err| CmdError::Failure(anyhow!("{err}"))) + .map_err(|err| CmdError::Failure(anyhow!(err))) } } }