forked from M-Labs/ionpak-thermostat
style
This commit is contained in:
parent
e126bc0fe1
commit
87de8b7859
@ -154,8 +154,7 @@ fn report(input: &[u8]) -> IResult<&[u8], Command> {
|
||||
preceded(
|
||||
whitespace,
|
||||
// `report mode <on | off>` - 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<Command, Error>> {
|
||||
|
||||
/// `pid` | pid_parameter
|
||||
fn pid(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
||||
preceded(
|
||||
tag("pid"),
|
||||
let (input, _) = tag("pid")(input)?;
|
||||
alt((
|
||||
preceded(
|
||||
whitespace,
|
||||
pid_parameter
|
||||
),
|
||||
value(Ok(Command::Show(ShowCommand::Pid)), end)
|
||||
))
|
||||
)(input)
|
||||
))(input)
|
||||
}
|
||||
|
||||
fn command(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
||||
|
@ -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
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user