The Bufferclean function doesn't consider the case that when buffer.start < 16 the alignment causes new_end to be larger than old_end. This causes an underflow in https://github.com/aseyboldt/fastq-rs/blob/master/src/buffer.rs#L72 which happened to me when I was parsing a gzipped fastq file.
If you want to align you could change the result into an isize or not move the data when buffer.start is less than 16. Or since the result is never used you could skip it entirely.
You are right, thank you. I removed the return value in Buffer.clean. It was meant as a way to detect if the buffer is too small, but it turned out I didn't need it and forgot to remove it.
The
Buffer
clean
function doesn't consider the case that whenbuffer.start < 16
the alignment causesnew_end
to be larger thanold_end
. This causes an underflow in https://github.com/aseyboldt/fastq-rs/blob/master/src/buffer.rs#L72 which happened to me when I was parsing a gzipped fastq file.If you want to align you could change the result into an
isize
or not move the data whenbuffer.start
is less than 16. Or since the result is never used you could skip it entirely.