1
Fork 0
mirror of https://github.com/Steffo99/patched-porobot.git synced 2024-12-22 17:44:22 +00:00

Implement From<CardType> for String

This commit is contained in:
Steffo 2022-08-06 19:52:04 +02:00
parent b013b9f0f2
commit 1e4efa6b97
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -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)]
mod tests {
use super::CardType;