hyper icon indicating copy to clipboard operation
hyper copied to clipboard

Replace transmute with bounded manual `Send` impl

Open djkoloski opened this issue 2 years ago • 0 comments

Requires https://github.com/hyperium/h2/pull/614 before this will compile.

We can avoid a transmute and some questionable code by using a specially-crafted conditional Send impl. Sendable and the impl are inside a const _: () = { ... } block to prevent the otherwise unsound Sendable type from being visible to the rest of the crate.

I believe that both versions are equally sound, but this helps prevent future issues and makes auditing the code more straightforward.

djkoloski avatar May 10 '22 20:05 djkoloski