command_parser: fix input_remain match

This commit is contained in:
Astro 2020-10-30 15:04:14 +01:00
parent d517dd75fe
commit ffb70bde0a

View File

@ -465,7 +465,7 @@ fn command(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
impl Command { impl Command {
pub fn parse(input: &[u8]) -> Result<Self, Error> { pub fn parse(input: &[u8]) -> Result<Self, Error> {
match command(input) { match command(input) {
Ok((b"", result)) => Ok((input_remain, result)) if input_remain.len() == 0 =>
result, result,
Ok((input_remain, _)) => Ok((input_remain, _)) =>
Err(Error::UnexpectedInput(input_remain[0])), Err(Error::UnexpectedInput(input_remain[0])),