Skip to content

Commit b8d677f

Browse files
committed
Removed usage of soft deprecated addr_of!
1 parent 18ee7b5 commit b8d677f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::io::Read;
1111
use std::iter::FusedIterator;
1212
use std::mem::MaybeUninit;
1313
use std::ops::Deref;
14-
use std::ptr::{addr_of, addr_of_mut, NonNull};
14+
use std::ptr::NonNull;
1515
use std::str::FromStr;
1616
use std::{mem, slice};
1717

@@ -143,7 +143,7 @@ impl<const N: usize> Buf<N> {
143143
} else {
144144
// TODO: replace by transpose when maybe_uninit_uninit_array_transpose stabilized.
145145
// https://github.com/rust-lang/rust/issues/96097
146-
addr_of!(self.data.inline)
146+
(&raw const self.data.inline)
147147
.cast::<u8>()
148148
.byte_sub(Self::INLINE_DATA_POS)
149149
}
@@ -158,7 +158,7 @@ impl<const N: usize> Buf<N> {
158158
} else {
159159
// TODO: replace by transpose when maybe_uninit_uninit_array_transpose stabilized.
160160
// https://github.com/rust-lang/rust/issues/96097
161-
addr_of_mut!(self.data.inline)
161+
(&raw mut self.data.inline)
162162
.cast::<u8>()
163163
.byte_sub(Self::INLINE_DATA_POS)
164164
}

0 commit comments

Comments
 (0)