Day 2 and 3 improvements
This commit is contained in:
@ -10,12 +10,9 @@ enum Symbol {
|
||||
impl From<char> for Symbol {
|
||||
fn from(value: char) -> Self {
|
||||
match value {
|
||||
'A' => Self::Rock,
|
||||
'B' => Self::Paper,
|
||||
'C' => Self::Scissors,
|
||||
'X' => Self::Rock,
|
||||
'Y' => Self::Paper,
|
||||
'Z' => Self::Scissors,
|
||||
'A' | 'X' => Self::Rock,
|
||||
'B' | 'Y' => Self::Paper,
|
||||
'C' | 'Z' => Self::Scissors,
|
||||
_ => panic!("invalid input"),
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user