forked from M-Labs/thermostat
command_parser: fix input_remain match
This commit is contained in:
parent
d517dd75fe
commit
ffb70bde0a
|
@ -465,7 +465,7 @@ fn command(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
|||
impl Command {
|
||||
pub fn parse(input: &[u8]) -> Result<Self, Error> {
|
||||
match command(input) {
|
||||
Ok((b"", result)) =>
|
||||
Ok((input_remain, result)) if input_remain.len() == 0 =>
|
||||
result,
|
||||
Ok((input_remain, _)) =>
|
||||
Err(Error::UnexpectedInput(input_remain[0])),
|
||||
|
|
Loading…
Reference in New Issue