Skip to content

Commit

Permalink
Make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
rozbb committed Nov 1, 2023
1 parent c737d9b commit 8071174
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hybrid-array/src/impl_serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ where
// If there's a value allegedly remaining, and deserializing it doesn't fail, then that's a
// length mismatch error
if seq.size_hint() != Some(0) && seq.next_element::<Dummy>()?.is_some() {
Err(de::Error::invalid_length(N::USIZE + 1, &self))
// The addition only saturates if this array is the size of all addressable memory. Not
// going to happen. And if it did, the only effect is an off-by-one error message
Err(de::Error::invalid_length(N::USIZE.saturating_add(1), &self))
} else {
arr
}
Expand Down

0 comments on commit 8071174

Please sign in to comment.