From 5fcb1fd6c3a18ad9cc85308eeb39e1e31dc70732 Mon Sep 17 00:00:00 2001 From: Avril Date: Mon, 28 Dec 2020 00:20:56 +0000 Subject: [PATCH] work r/w loop okey --- src/work.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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,