Closed
Description
Here's a code sample:
warning: transmute from a reference to a pointer
--> src/main.rs:35:29
|
35 | let fd = libc::open(mem::transmute(b"/dev/null\0"), libc::O_RDONLY);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(useless_transmute)] on by default
help: try
| let fd = libc::open(b"/dev/null\0" as *const [u8; 10] as *const i8, libc::O_RDONLY);
= help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#useless_transmute
That seems kind of silly. It's not useless; it's doing two casts at once (reference to pointer, and then pointer to different pointer) and saving quite a bit of typing.