hyperium / hyper

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

refactor(proto): replace map and unwrap_or combination with map_or #3639

Closed tottoto closed 2 months ago

tottoto commented 2 months ago

The Option::map and Option::unwrap_or methods combination could be written as more idiomatic API Option::map_or. In this case, there is a more idiomatic API Option::is_some_and, but it requires Rust 1.70.

https://doc.rust-lang.org/std/option/enum.Option.html#method.is_some_and