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/routes/demo.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 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 1a6ae9a..f9929f7 100644 --- a/planetwars-server/src/routes/demo.rs +++ b/planetwars-server/src/routes/demo.rs @@ -47,8 +47,14 @@ pub async fn submit_bot( .expect("could not save bot code"); let mut run_match = RunMatch::from_players(vec![ - MatchPlayer::from_code_bundle_version(&player_bot_version), - MatchPlayer::from_bot_version(&opponent_bot, &opponent_bot_version), + MatchPlayer::BotVersion { + bot: None, + version: player_bot_version.clone(), + }, + MatchPlayer::BotVersion { + bot: Some(opponent_bot.clone()), + version: opponent_bot_version.clone(), + }, ]); let match_data = run_match .store_in_database(&conn) -- cgit v1.2.3