Skip to content

Commit c9aa7da

Browse files
committed
Don't transmute when we don't need to.
1 parent fd531bc commit c9aa7da

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • plotters-bitmap/src/bitmap_pixel

plotters-bitmap/src/bitmap_pixel/bgrx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl PixelFormat for BGRXPixel {
193193
// TODO: Consider using AVX instructions when possible
194194
let ptr = p as *mut [u8; 8] as *mut u64;
195195
unsafe {
196-
let d: u64 = std::mem::transmute([
196+
let d: u64 = u64::from_ne_bytes([
197197
b, g, r, 0, b, g, r, 0, // QW1
198198
]);
199199
ptr.write_unaligned(d);

0 commit comments

Comments
 (0)