sized_buffer returns incomplete

This commit is contained in:
Geoffroy Couprie 2014-12-02 18:55:30 +01:00
parent f3a528ca26
commit b11b94b395

View File

@ -226,8 +226,7 @@ pub fn alphanumeric(input:&[u8]) -> IResult<&[u8], &[u8]> {
pub fn sized_buffer(input:&[u8]) -> IResult<&[u8], &[u8]> {
if input.len() == 0 {
//FIXME: should return Incomplete
return Error(0)
return Incomplete(0)
}
let len = input[0] as uint;
@ -235,8 +234,7 @@ pub fn sized_buffer(input:&[u8]) -> IResult<&[u8], &[u8]> {
if input.len() >= len + 1 {
return Done(input.slice_from(len+1), input.slice(1, len+1))
} else {
//FIXME: should return Incomplete
return Error(0)
return Incomplete(0)
}
}