From 353ecd4c165042234e9f976b158bc970517940f5 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Thu, 13 Oct 2022 23:42:44 +0200 Subject: basic test for list_matches and had_errors --- planetwars-server/src/routes/matches.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'planetwars-server/src/routes') diff --git a/planetwars-server/src/routes/matches.rs b/planetwars-server/src/routes/matches.rs index 99c6d1a..6845e90 100644 --- a/planetwars-server/src/routes/matches.rs +++ b/planetwars-server/src/routes/matches.rs @@ -32,6 +32,7 @@ pub struct ApiMatchPlayer { bot_version_id: Option, bot_id: Option, bot_name: Option, + had_errors: Option, } #[derive(Serialize, Deserialize)] @@ -117,10 +118,11 @@ pub fn match_data_to_api(data: matches::FullMatchData) -> ApiMatch { players: data .match_players .iter() - .map(|_p| ApiMatchPlayer { - bot_version_id: _p.bot_version.as_ref().map(|cb| cb.id), - bot_id: _p.bot.as_ref().map(|b| b.id), - bot_name: _p.bot.as_ref().map(|b| b.name.clone()), + .map(|p| ApiMatchPlayer { + bot_version_id: p.bot_version.as_ref().map(|cb| cb.id), + bot_id: p.bot.as_ref().map(|b| b.id), + bot_name: p.bot.as_ref().map(|b| b.name.clone()), + had_errors: p.base.had_errors, }) .collect(), winner: data.base.winner, -- cgit v1.2.3