hyperium / hyper

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

Fix confusing usage of TokioTimer in hello.rs example #3658

Closed krakow10 closed 1 month ago

krakow10 commented 1 month ago

The usage of TokioTimer in the example differs from how it would be used with the hyper-util crate. When you try to use the code like you see in the example, it says the type is private, but it is clearly public in the source code of hyper-util. After coming back to this months later, it seems that in hyper-util itself, the usage of #[non_exhaustive] makes the type unconstructable outside the crate, which necessitates using the ::new() method.