Skip to content

Commit a53e140

Browse files
Keatsboydgreenfield
authored andcommitted
Fix for Rust 1.70
1 parent a8c7c5d commit a53e140

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mmap_bitvec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ impl BitVector for MmapBitVec {
513513
// we have to transmute since we don't know if it's a u64 or u128
514514
#[allow(clippy::transmute_ptr_to_ptr)]
515515
let lg_ptr: *const u128 = transmute(ptr.add(byte_idx_st));
516-
v |= (*lg_ptr).to_be() << (r.start & 7) >> (128 - new_size);
516+
v |= lg_ptr.read_unaligned().to_be() << (r.start & 7) >> (128 - new_size);
517517
}
518518
} else {
519519
// special case if we can't get a whole u64 out without running outside the buffer
@@ -526,7 +526,7 @@ impl BitVector for MmapBitVec {
526526
}
527527

528528
// mask out the high bits in case we copied extra
529-
v & (u128::max_value() >> (128 - new_size))
529+
v & (u128::MAX >> (128 - new_size))
530530
}
531531

532532
/// Set an unaligned range of bits using a `u64`.

0 commit comments

Comments
 (0)