From ae57359353cf31ff374a8932999742920878bf00 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Wed, 12 Oct 2022 22:52:15 +0200 Subject: upgrade to diesel 2.0 --- planetwars-server/src/routes/demo.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'planetwars-server/src/routes/demo.rs') 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, Extension(config): Extension>, ) -> Result, 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"); -- cgit v1.2.3