Skip to content

Commit

Permalink
Resolve clippy transmute_ptr_to_ptr lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Dec 12, 2021
1 parent f7502e2 commit 52466ab
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/lib.rs
Expand Up @@ -39,7 +39,6 @@
clippy::missing_errors_doc,
clippy::must_use_candidate,
clippy::semicolon_if_nothing_returned, // https://github.com/rust-lang/rust-clippy/issues/7768
clippy::transmute_ptr_to_ptr,
clippy::unreadable_literal
)]

Expand Down Expand Up @@ -89,10 +88,8 @@ impl Buffer {
/// representation within the buffer.
pub fn format<I: Integer>(&mut self, i: I) -> &str {
i.write(unsafe {
mem::transmute::<
&mut [MaybeUninit<u8>; I128_MAX_LEN],
&mut <I as private::Sealed>::Buffer,
>(&mut self.bytes)
&mut *(&mut self.bytes as *mut [MaybeUninit<u8>; I128_MAX_LEN]
as *mut <I as private::Sealed>::Buffer)
})
}
}
Expand Down

0 comments on commit 52466ab

Please sign in to comment.