aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/modules/client_api.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-10-12 22:52:15 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-10-12 22:52:15 +0200
commitae57359353cf31ff374a8932999742920878bf00 (patch)
tree0db27d394a2a61a5cc94e73014c82954829c1338 /planetwars-server/src/modules/client_api.rs
parented016773b112460ebbf0ff023b0915545229ed41 (diff)
downloadplanetwars.dev-ae57359353cf31ff374a8932999742920878bf00.tar.xz
planetwars.dev-ae57359353cf31ff374a8932999742920878bf00.zip
upgrade to diesel 2.0
Diffstat (limited to 'planetwars-server/src/modules/client_api.rs')
-rw-r--r--planetwars-server/src/modules/client_api.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/planetwars-server/src/modules/client_api.rs b/planetwars-server/src/modules/client_api.rs
index 6e5d05a..9c0bbe7 100644
--- a/planetwars-server/src/modules/client_api.rs
+++ b/planetwars-server/src/modules/client_api.rs
@@ -149,19 +149,19 @@ impl pb::client_api_service_server::ClientApiService for ClientApiServer {
req: Request<pb::CreateMatchRequest>,
) -> Result<Response<pb::CreateMatchResponse>, Status> {
// TODO: unify with matchrunner module
- let conn = self.conn_pool.get().await.unwrap();
+ let mut conn = self.conn_pool.get().await.unwrap();
let match_request = req.get_ref();
let (opponent_bot, opponent_bot_version) =
- db::bots::find_bot_with_version_by_name(&match_request.opponent_name, &conn)
+ db::bots::find_bot_with_version_by_name(&match_request.opponent_name, &mut conn)
.map_err(|_| Status::not_found("opponent not found"))?;
let map_name = match match_request.map_name.as_str() {
"" => "hex",
name => name,
};
- let map = db::maps::find_map_by_name(map_name, &conn)
+ let map = db::maps::find_map_by_name(map_name, &mut conn)
.map_err(|_| Status::not_found("map not found"))?;
let player_key = gen_alphanumeric(32);