From 326da19523235a16a04ce72c7f32ab50e47cb628 Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Sat, 2 Sep 2023 21:27:21 -0400 Subject: [PATCH] Make player name optional --- cli/src/queries/player_info.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/queries/player_info.rs b/cli/src/queries/player_info.rs index 230351c..dbe5714 100644 --- a/cli/src/queries/player_info.rs +++ b/cli/src/queries/player_info.rs @@ -27,7 +27,7 @@ struct Player { // Unwrapping pub struct PlayerInfoResponse { - pub name: String, + pub name: Option, pub prefix: Option, } @@ -37,7 +37,7 @@ impl QueryUnwrap for PlayerInfo { fn unwrap_response(response: GraphQlResponse) -> Option { let player = response.data?.player?; Some(PlayerInfoResponse { - name: player.gamer_tag?, + name: player.gamer_tag, prefix: player.prefix.filter(|pr| !pr.is_empty()), }) }