Skip to content

Commit

Permalink
Apply jgallagher suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: John Gallagher <[email protected]>
  • Loading branch information
papertigers and jgallagher authored Nov 6, 2023
1 parent 32082dd commit f2a4fe5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions gateway/src/bin/mgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion oximeter/collector/src/bin/oximeter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions sled-agent/src/bin/sled-agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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(())
}
Expand Down
6 changes: 3 additions & 3 deletions wicketd/src/bin/wicketd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)))
}
}
}

0 comments on commit f2a4fe5

Please sign in to comment.