Closed wyfo closed 3 weeks ago
I'm honestly worried about having so much transmute in the code (I've replaced a few of them), but for now, I just obeyed to the warning.
As the problematic transmute are about lifetime, particularly for mutable reference writes, you may be interested in https://doc.rust-lang.org/src/std/io/impls.rs.html#362-399 or https://github.com/tokio-rs/bytes/blob/fa1daac3ae1dcb07dffe3a41a041dffd6edf177b/src/buf/buf_mut.rs#L1493. I didn't try to modify this unsafe code myself in this PR.
I'm honestly worried about having so much transmute in the code (I've replaced a few of them), but for now, I just obeyed to the warning.
As the problematic transmute are about lifetime, particularly for mutable reference writes, you may be interested in https://doc.rust-lang.org/src/std/io/impls.rs.html#362-399 or https://github.com/tokio-rs/bytes/blob/fa1daac3ae1dcb07dffe3a41a041dffd6edf177b/src/buf/buf_mut.rs#L1493. I didn't try to modify this unsafe code myself in this PR.
Interesting, it is definitely worth a try.
@Mallets