diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-10-12 22:52:15 +0200 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-10-12 22:52:15 +0200 |
commit | ae57359353cf31ff374a8932999742920878bf00 (patch) | |
tree | 0db27d394a2a61a5cc94e73014c82954829c1338 /planetwars-server/src/routes/demo.rs | |
parent | ed016773b112460ebbf0ff023b0915545229ed41 (diff) | |
download | planetwars.dev-ae57359353cf31ff374a8932999742920878bf00.tar.xz planetwars.dev-ae57359353cf31ff374a8932999742920878bf00.zip |
upgrade to diesel 2.0
Diffstat (limited to 'planetwars-server/src/routes/demo.rs')
-rw-r--r-- | planetwars-server/src/routes/demo.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/planetwars-server/src/routes/demo.rs b/planetwars-server/src/routes/demo.rs index 1ec8825..cd490ef 100644 --- a/planetwars-server/src/routes/demo.rs +++ b/planetwars-server/src/routes/demo.rs @@ -35,7 +35,7 @@ pub async fn submit_bot( Extension(pool): Extension<ConnectionPool>, Extension(config): Extension<Arc<GlobalConfig>>, ) -> Result<Json<SubmitBotResponse>, StatusCode> { - let conn = pool.get().await.expect("could not get database connection"); + let mut conn = pool.get().await.expect("could not get database connection"); let opponent_name = params .opponent_name @@ -46,12 +46,13 @@ pub async fn submit_bot( .unwrap_or_else(|| DEFAULT_MAP_NAME.to_string()); let (opponent_bot, opponent_bot_version) = - db::bots::find_bot_with_version_by_name(&opponent_name, &conn) + db::bots::find_bot_with_version_by_name(&opponent_name, &mut conn) .map_err(|_| StatusCode::BAD_REQUEST)?; - let map = db::maps::find_map_by_name(&map_name, &conn).map_err(|_| StatusCode::BAD_REQUEST)?; + let map = + db::maps::find_map_by_name(&map_name, &mut conn).map_err(|_| StatusCode::BAD_REQUEST)?; - let player_bot_version = save_code_string(¶ms.code, None, &conn, &config) + let player_bot_version = save_code_string(¶ms.code, None, &mut conn, &config) // TODO: can we recover from this? .expect("could not save bot code"); |