Merge pull request #2191 from TheBlueMatt/2023-04-fix-bucket-deser

Fix deserialization of u16 arrays
This commit is contained in:
Matt Corallo 2023-04-17 15:11:53 +00:00 committed by GitHub
commit c977def259
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -596,7 +596,7 @@ impl Readable for [u16; 8] {
r.read_exact(&mut buf)?;
let mut res = [0u16; 8];
for (idx, v) in res.iter_mut().enumerate() {
*v = (buf[idx] as u16) << 8 | (buf[idx + 1] as u16)
*v = (buf[idx*2] as u16) << 8 | (buf[idx*2 + 1] as u16)
}
Ok(res)
}