Skip to content

Commit

Permalink
Closes #43
Browse files Browse the repository at this point in the history
The byte-reärranging functions in `macros/internals.rs` had
copy-paste errors in the `u64` variants.
  • Loading branch information
myrrlyn committed Mar 4, 2020
1 parent e90f619 commit 9557bc6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/macros/internal.rs
Expand Up @@ -511,13 +511,13 @@ pub const fn u32_from_le_bytes(bytes: [u8; 4]) -> u32 {

#[doc(hidden)]
pub const fn u64_from_be_bytes(bytes: [u8; 8]) -> u64 {
(u32_from_be_bytes([bytes[4], bytes[5], bytes[6], bytes[7]]) as u64) << 32
| u32_from_be_bytes([bytes[0], bytes[1], bytes[2], bytes[3]]) as u64
(u32_from_be_bytes([bytes[0], bytes[1], bytes[2], bytes[3]]) as u64) << 32
| (u32_from_be_bytes([bytes[4], bytes[5], bytes[6], bytes[7]]) as u64)
}

#[doc(hidden)]
pub const fn u64_from_le_bytes(bytes: [u8; 8]) -> u64 {
(u32_from_le_bytes([bytes[0], bytes[1], bytes[2], bytes[3]]) as u64) << 32
(u32_from_le_bytes([bytes[4], bytes[5], bytes[6], bytes[7]]) as u64) << 32
| u32_from_le_bytes([bytes[0], bytes[1], bytes[2], bytes[3]]) as u64
}

Expand Down

0 comments on commit 9557bc6

Please sign in to comment.