fix incomplete condition
This commit is contained in:
parent
b049f70dce
commit
a1e9a3f90c
@ -25,7 +25,7 @@ pub fn incomplete<O>(input: &[u8], size: Option<usize>) -> IResult<O> {
|
|||||||
|
|
||||||
pub fn take_bytes<CC: Into<usize>>(input: &[u8], count: CC) -> IResult<&[u8]> {
|
pub fn take_bytes<CC: Into<usize>>(input: &[u8], count: CC) -> IResult<&[u8]> {
|
||||||
let cc = count.into();
|
let cc = count.into();
|
||||||
if input.len() > cc {
|
if input.len() < cc {
|
||||||
incomplete(input, Some(cc))
|
incomplete(input, Some(cc))
|
||||||
} else {
|
} else {
|
||||||
let (taken, input) = input.split_at(cc);
|
let (taken, input) = input.split_at(cc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user