From e69bd14f1d64b0d8b2438a40a069d3647c1edd73 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Tue, 12 Jul 2022 20:54:00 +0200 Subject: refactor: delay BotSpec construction in RunMatch --- planetwars-server/src/modules/ranking.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'planetwars-server/src/modules/ranking.rs') diff --git a/planetwars-server/src/modules/ranking.rs b/planetwars-server/src/modules/ranking.rs index 3182ce2..7147b98 100644 --- a/planetwars-server/src/modules/ranking.rs +++ b/planetwars-server/src/modules/ranking.rs @@ -41,7 +41,10 @@ async fn play_ranking_match(selected_bots: Vec, db_pool: DbPool) { for bot in &selected_bots { let version = db::bots::active_bot_version(bot.id, &db_conn) .expect("could not get active bot version"); - let player = MatchPlayer::from_bot_version(bot, &version); + let player = MatchPlayer::BotVersion { + bot: Some(bot.clone()), + version, + }; players.push(player); } -- cgit v1.2.3