hyper icon indicating copy to clipboard operation
hyper copied to clipboard

Rename the HttpBody export to Body

Open seanmonstar opened this issue 2 years ago • 2 comments

When the concrete Body struct is removed, we can export the http_body::Body trait as just Body.

seanmonstar avatar May 20 '22 17:05 seanmonstar

What would be the advantage in case of import both trait and struct?

yuri-potatoq avatar May 22 '22 15:05 yuri-potatoq

The struct will be removed, as detailed in #2345.

seanmonstar avatar May 22 '22 15:05 seanmonstar

I am just starting up with Hyper so would like to work on this task (if that's ok). By renaming and exporting the http_body::Body trait as just Body, I assume you are talking about updating the following:

https://github.com/hyperium/hyper/blob/84f6ae78d62f0ca3b85f86ea92887dc46ed9717e/src/body/mod.rs#L19-L23

But since the concrete Body type is already exported as Body, wouldn't that cause a conflict? Should I get rid of the concrete type export?

RajivTS avatar Aug 20 '22 18:08 RajivTS

Yes, we'd need to finish removing parts of Body, and renaming that. Then this one would be straightforward.

seanmonstar avatar Aug 20 '22 18:08 seanmonstar

Is there a separate task that I can work on to remove parts of Body?

RajivTS avatar Aug 20 '22 18:08 RajivTS

@RajivTS The top comment in #2345 includes a list of tasks, and I tried to put them in order of unblocking the next one. Some are linked to specific issues, we can make more of them issues too.

seanmonstar avatar Aug 25 '22 00:08 seanmonstar

This is no longer blocked, since Body was renamed to Recv as a stop-gap (#2963).

seanmonstar avatar Aug 26 '22 15:08 seanmonstar

@seanmonstar Created PR to address this, would appreciate a review to understand if I missed something.

RajivTS avatar Aug 28 '22 23:08 RajivTS