aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/routes/matches.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-03-13 15:20:03 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2022-03-13 15:20:03 +0100
commitfd52e266c6e25999a49c36f17342977b759a2612 (patch)
tree9c727cac949c9698343d003ee87cfe73c6c6204a /planetwars-server/src/routes/matches.rs
parentf7655005ff099e8314ecd31e95b26ad74d4efd02 (diff)
downloadplanetwars.dev-fd52e266c6e25999a49c36f17342977b759a2612.tar.xz
planetwars.dev-fd52e266c6e25999a49c36f17342977b759a2612.zip
apply clippy suggestions
Diffstat (limited to 'planetwars-server/src/routes/matches.rs')
-rw-r--r--planetwars-server/src/routes/matches.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/planetwars-server/src/routes/matches.rs b/planetwars-server/src/routes/matches.rs
index 9fa532e..991a4b5 100644
--- a/planetwars-server/src/routes/matches.rs
+++ b/planetwars-server/src/routes/matches.rs
@@ -57,8 +57,7 @@ pub async fn play_match(
code_path: PathBuf::from(BOTS_DIR).join(code_bundle.path),
image: "python:3.10-slim-buster".to_string(),
argv: shlex::split(&bot_config.run_command)
- // TODO: this is an user error, should ideally be handled before we get here
- .ok_or_else(|| StatusCode::INTERNAL_SERVER_ERROR)?,
+ .ok_or(StatusCode::INTERNAL_SERVER_ERROR)?,
}),
});
@@ -152,7 +151,7 @@ pub async fn get_match_data(
) -> Result<Json<ApiMatch>, StatusCode> {
let match_data = matches::find_match(match_id, &conn)
.map_err(|_| StatusCode::NOT_FOUND)
- .map(|data| match_data_to_api(data))?;
+ .map(match_data_to_api)?;
Ok(Json(match_data))
}