mirror of
https://github.com/Steffo99/patched-porobot.git
synced 2024-12-23 01:54:22 +00:00
Implement From<CardType>
for String
This commit is contained in:
parent
b013b9f0f2
commit
1e4efa6b97
1 changed files with 14 additions and 0 deletions
|
@ -32,6 +32,20 @@ pub enum CardType {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
impl From<CardType> for String {
|
||||||
|
fn from(r#type: CardType) -> Self {
|
||||||
|
match r#type {
|
||||||
|
CardType::Spell => String::from("Spell"),
|
||||||
|
CardType::Unit => String::from("Unit"),
|
||||||
|
CardType::Ability => String::from("Ability"),
|
||||||
|
CardType::Landmark => String::from("Landmark"),
|
||||||
|
CardType::Trap => String::from("Trap"),
|
||||||
|
CardType::Unsupported => String::from("Unknown"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::CardType;
|
use super::CardType;
|
||||||
|
|
Loading…
Reference in a new issue