diff --git a/src/legacy/shrink.rs b/src/legacy/shrink.rs index 5c08e8ea1..9db7ad78d 100644 --- a/src/legacy/shrink.rs +++ b/src/legacy/shrink.rs @@ -125,20 +125,17 @@ fn read_code( } // Handle control codes. - let control_code = if let Ok(c) = is.read::(*code_size as u32) { - c - } else { - return Ok(None); - }; - if control_code == INC_CODE_SIZE && *code_size < MAX_CODE_SIZE { - (*code_size) += 1; - return read_code(is, code_size, codetab, queue); - } - if control_code == PARTIAL_CLEAR { - unshrink_partial_clear(codetab, queue); - return read_code(is, code_size, codetab, queue); + if let Ok(control_code) = is.read::(*code_size as u32) { + if control_code == INC_CODE_SIZE && *code_size < MAX_CODE_SIZE { + *code_size += 1; + return read_code(is, code_size, codetab, queue); + } + if control_code == PARTIAL_CLEAR { + unshrink_partial_clear(codetab, queue); + return read_code(is, code_size, codetab, queue); + } } - return Ok(None); + Ok(None) } /// Output the string represented by a code into dst at dst_pos. Returns