diff --git a/firmware/src/command_parser.rs b/firmware/src/command_parser.rs index 1a2269e..f27a3d8 100644 --- a/firmware/src/command_parser.rs +++ b/firmware/src/command_parser.rs @@ -154,8 +154,7 @@ fn report(input: &[u8]) -> IResult<&[u8], Command> { preceded( whitespace, // `report mode ` - Switch repoting mode - map(off_on, - |reporting| Command::Reporting(reporting)) + map(off_on, Command::Reporting) ), // `report mode` - Show current reporting state value(Command::Show(ShowCommand::Reporting), end) @@ -235,16 +234,14 @@ fn pid_parameter(input: &[u8]) -> IResult<&[u8], Result> { /// `pid` | pid_parameter fn pid(input: &[u8]) -> IResult<&[u8], Result> { - preceded( - tag("pid"), - alt(( - preceded( - whitespace, - pid_parameter - ), - value(Ok(Command::Show(ShowCommand::Pid)), end) - )) - )(input) + let (input, _) = tag("pid")(input)?; + alt(( + preceded( + whitespace, + pid_parameter + ), + value(Ok(Command::Show(ShowCommand::Pid)), end) + ))(input) } fn command(input: &[u8]) -> IResult<&[u8], Result> { diff --git a/firmware/src/main.rs b/firmware/src/main.rs index 3d76c18..b756934 100644 --- a/firmware/src/main.rs +++ b/firmware/src/main.rs @@ -138,7 +138,7 @@ fn main() -> ! { writeln!(stdout, "ADC id: {:04X}", id).unwrap(); break; } - Ok(id) => { + Ok(_id) => { // This always happens on the first attempt. So retry silently } };