hyperium / hyper

An HTTP library for Rust
https://hyper.rs
MIT License
14.58k stars 1.6k forks source link

Remove Body's `Once` variant #2922

Closed seanmonstar closed 2 years ago

seanmonstar commented 2 years ago

It was noted that the FFI body type makes use of Body::empty(). I think there's 2 ways we can fix that:

  1. Add a pub(crate) fn ffi() -> Body that just starts the type like this: https://github.com/hyperium/hyper/blob/509672aada0af68a91d963e69828c6e31c44cb7b/src/body/body.rs#L240
  2. Or, keep an Empty variant. I don't think I like this option as much, but welcome feedback.
seanmonstar commented 2 years ago

cc @Xuanwo

Xuanwo commented 2 years ago
  1. Add a pub(crate) fn ffi() -> Body that just starts the type like this

Let me give this a try!