diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-07-12 20:54:00 +0200 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-07-12 20:54:00 +0200 |
commit | e69bd14f1d64b0d8b2438a40a069d3647c1edd73 (patch) | |
tree | fd16f12c56a9f51716e7908cb7180b892d01edc9 /planetwars-server/src/modules/ranking.rs | |
parent | 0b9a9f0eaafb68acb7896ade26b9ae4508096d5c (diff) | |
download | planetwars.dev-e69bd14f1d64b0d8b2438a40a069d3647c1edd73.tar.xz planetwars.dev-e69bd14f1d64b0d8b2438a40a069d3647c1edd73.zip |
refactor: delay BotSpec construction in RunMatch
Diffstat (limited to 'planetwars-server/src/modules/ranking.rs')
-rw-r--r-- | planetwars-server/src/modules/ranking.rs | 5 |
1 files changed, 4 insertions, 1 deletions
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<Bot>, 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); } |