mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-27 18:26:19 +00:00
Use size_of from the prelude instead of imported
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the
prelude instead of importing or qualifying them.
These functions were added to all preludes in Rust 1.80.
This commit is contained in:
parent
0aa623e108
commit
0811ca0a61
11 changed files with 24 additions and 34 deletions
|
|
@ -1825,7 +1825,7 @@ macro_rules! impl_int {
|
|||
($($t:ty)*) => {
|
||||
$(
|
||||
impl $t {
|
||||
pub const fn from_ne_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
|
||||
pub const fn from_ne_bytes(bytes: [u8; size_of::<Self>()]) -> Self {
|
||||
unsafe { mem::transmute(bytes) }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue