Change (c : char) in

parse_orientation()
parse_instruction()
to (c: &char)
This commit is contained in:
mhart 2020-10-11 20:24:35 +02:00
parent 6e1589ff7d
commit edf29050c6

View File

@ -11,7 +11,7 @@ enum Instruction {
F, F,
} }
fn parse_orientation(c: char) -> Result<Orientation, &'static str> { fn parse_orientation(c: &char) -> Result<Orientation, &'static str> {
match c { match c {
'N' => Ok(Orientation::N), 'N' => Ok(Orientation::N),
'E' => Ok(Orientation::E), 'E' => Ok(Orientation::E),
@ -21,7 +21,7 @@ fn parse_orientation(c: char) -> Result<Orientation, &'static str> {
} }
} }
fn parse_instruction(c: char) -> Result<Instruction, &'static str> { fn parse_instruction(c: &char) -> Result<Instruction, &'static str> {
match c { match c {
'L' => Ok(Instruction::L), 'L' => Ok(Instruction::L),
'R' => Ok(Instruction::R), 'R' => Ok(Instruction::R),