hyperium / http

Rust HTTP types
Apache License 2.0
1.16k stars 291 forks source link

Audit use of unsafe in uri/authority.rs #414

Closed sbosnick closed 4 years ago

sbosnick commented 4 years ago

Refactor the common code from three ways of creating an Authority into a private create_authority() function, which removes some code duplication (including duplicated uses of "unsafe"). Add comments describing the implicit preconditions and postconditions in create_authority() and the functions it calls which then make explicit the sound use of "unsafe" (as described in the "Safety" comment in create_authority().

This is part of #412.