Skip to content

Commit 45b441b

Browse files
Add competitive brawl format
Co-authored-by: chloebangbang <kojlax@protonmail.com>
1 parent 7111a43 commit 45b441b

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/card.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ use crate::util::CARDS_URL;
6868
),
6969
non_exhaustive
7070
)]
71-
#[serde(deny_unknown_fields)]
71+
#[cfg_attr(test, serde(deny_unknown_fields))]
7272
#[allow(missing_docs)]
7373
pub struct CardLegality {
7474
#[serde(default)]
@@ -117,6 +117,8 @@ pub struct CardLegality {
117117
pub standard_brawl: Legality,
118118
#[serde(default, rename = "historicbrawl")]
119119
pub historic_brawl: Legality,
120+
#[serde(default, rename = "competitivebrawl")]
121+
pub competitive_brawl: Legality,
120122
#[serde(default)]
121123
pub tlr: Legality,
122124
}
@@ -149,6 +151,7 @@ impl Index<Format> for CardLegality {
149151
Format::Timeless => &self.timeless,
150152
Format::StandardBrawl => &self.standard_brawl,
151153
Format::HistoricBrawl => &self.historic_brawl,
154+
Format::CompetitiveBrawl => &self.competitive_brawl,
152155
Format::TLR => &self.tlr,
153156
}
154157
}
@@ -180,6 +183,7 @@ impl IndexMut<Format> for CardLegality {
180183
Format::Timeless => &mut self.timeless,
181184
Format::StandardBrawl => &mut self.standard_brawl,
182185
Format::HistoricBrawl => &mut self.historic_brawl,
186+
Format::CompetitiveBrawl => &mut self.competitive_brawl,
183187
Format::TLR => &mut self.tlr,
184188
}
185189
}
@@ -563,6 +567,8 @@ pub struct Card {
563567
pub attraction_lights: Option<Vec<u8>>,
564568
/* ======================
565569
* endregion Print Fields */
570+
/// fooo
571+
pub image_updated_at: String,
566572
#[cfg(test)]
567573
#[serde(rename = "object")]
568574
_object: String,

src/format.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ pub enum Format {
3030
Timeless,
3131
StandardBrawl,
3232
HistoricBrawl,
33+
CompetitiveBrawl,
3334
TLR,
3435
}
3536

@@ -63,6 +64,7 @@ impl fmt::Display for Format {
6364
Timeless => "timeless",
6465
StandardBrawl => "standardbrawl",
6566
HistoricBrawl => "historicbrawl",
67+
CompetitiveBrawl => "competitivebrawl",
6668
TLR => "tlr",
6769
}
6870
)

0 commit comments

Comments
 (0)