Fix various clippy lints

This commit is contained in:
Paul Hauner
2019-05-28 10:56:05 +10:00
parent 6e5e1721f7
commit 21ecaddac1
6 changed files with 13 additions and 19 deletions

View File

@@ -102,9 +102,7 @@ impl<'a> SszDecoderBuilder<'a> {
.and_then(|o| Some(o.offset))
.unwrap_or_else(|| BYTES_PER_LENGTH_OFFSET);
if previous_offset > offset {
return Err(DecodeError::OutOfBoundsByte { i: offset });
} else if offset > self.bytes.len() {
if (previous_offset > offset) || (offset > self.bytes.len()) {
return Err(DecodeError::OutOfBoundsByte { i: offset });
}