diff --git a/src/work.rs b/src/work.rs index cb1cd5f..e362c80 100644 --- a/src/work.rs +++ b/src/work.rs @@ -10,7 +10,7 @@ pub fn work_on(job: &mut Job) -> Result> std::slice::from_raw_parts_mut(output.as_mut_ptr(), output.len()) }; let mut read=0; - loop { + while read < job.len() { match job.read(&mut output[read..])? { 0 => break, current => read+=current,