From 4a8a5e36bba2c6ca1acfd04e7d6f4cdc56c1c272 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 2 Aug 2022 10:12:55 +0200 Subject: [PATCH] Rename `associated_card_refs` to `associated_card_codes` --- src/data/schema.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/data/schema.rs b/src/data/schema.rs index 227ff30..1f33eab 100644 --- a/src/data/schema.rs +++ b/src/data/schema.rs @@ -5,8 +5,10 @@ use std::collections::HashMap; #[serde(rename_all="camelCase")] pub struct Card { /// Codes of other cards associated with this one. - /// To access - pub associated_card_refs: Vec, + /// + /// To access references to the cards themselves, use [associated_cards]. + #[serde(rename = "associated_card_refs")] + pub associated_card_codes: Vec, /// Art assets of this card. pub assets: Vec, @@ -78,7 +80,7 @@ pub struct Card { impl Card { /// Get references to the cards associated with this one, given an hashmap of all cards. pub fn associated_cards<'c, 'hm: 'c>(&'c self, hashmap: &'hm HashMap) -> impl Iterator> + 'c { - self.associated_card_refs.iter().map(|r| hashmap.get(r)) + self.associated_card_codes.iter().map(|r| hashmap.get(r)) } }