command_parser: fix input_remain match

This commit is contained in:
Astro 2020-10-30 15:04:14 +01:00
parent d517dd75fe
commit ffb70bde0a
1 changed files with 1 additions and 1 deletions

View File

@ -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])),