Skip to content

Commit af5ee02

Browse files
committed
Closes #43
The byte-reärranging functions in `macros/internals.rs` had copy-paste errors in the `u64` variants.
1 parent 6556a76 commit af5ee02

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/macros/internal.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,13 +511,13 @@ pub const fn u32_from_le_bytes(bytes: [u8; 4]) -> u32 {
511511

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

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

0 commit comments

Comments
 (0)