alyssais / hyper-stub

hyper clients that don't touch the network
https://crates.io/crates/hyper-stub
Mozilla Public License 2.0
11 stars 0 forks source link

Consider directly using http crate types over hyper re-exports #1

Open dekellum opened 6 years ago

dekellum commented 6 years ago

For the http crate types Request, Response, HeaderMap, etc, while these types are also re-exported by hyper, I think the http crate docs are better as a whole, and its less cognitive burden to reference these types directly, in your top level usage example and code. The same argument could be made for the futures and tokio crate types, though http was the first I noticed.

This said, I've developed some bias against broad use of re-exports, so I'd also appreciate hearing reasonable arguments for using those re-exports, and would encourage you to collect other opinions.

alyssais commented 6 years ago

Hey! The reason (if you could call it that – I didn't think about it too much) for using the re-exports was that it meant I didn't have to add extra extern crates, and therefore didn't have to declare extra dependencies, which I'd then have to make sure to been in sync with the other dependencies. This seemed like unnecessary effort. I didn't really think of any advantages. I will ask some other Rustaceans I know and see what I find.