diff options
| author | Stuart Cook <Zalathar@users.noreply.github.com> | 2025-09-19 22:31:51 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-19 22:31:51 +1000 |
| commit | ff8d63ae438f8d637e0e4663df8b12a8650ff51e (patch) | |
| tree | 47d6ecdade21862aae9d7ac98a3c4ba8fb42a2bd /compiler/rustc_codegen_llvm/src | |
| parent | fe0b51939cbe0a52182fdc9916c10f233d1a5c15 (diff) | |
| parent | 09d3120a99fee8d839e502bdb54f8117c0623c5d (diff) | |
| download | rust-ff8d63ae438f8d637e0e4663df8b12a8650ff51e.tar.gz rust-ff8d63ae438f8d637e0e4663df8b12a8650ff51e.zip | |
Rollup merge of #146541 - joboet:simplify-lookup-host, r=tgross35
std: simplify host lookup The logic for splitting up a string into a hostname and port is currently duplicated across (nearly) all of the networking implementations in `sys`. Since it does not actually rely on any system internals, this PR moves it to the `ToSocketAddr` implementation for `&str`, making it easier to discover and maintain. On the other hand, the `ToSocketAddr` implementation (or rather the `resolve_socket_addr` function) contained logic to overwrite the port on the socket addresses returned by `LookupHost`, even though `LookupHost` is already aware of the port and sets the port already on Xous. This PR thus removes this logic by moving the responsibility of setting the port to the system-specific `LookupHost` implementation. As a consequence of these changes, there remains only one way of creating `LookupHost`, hence I've removed the `TryFrom` implementations in favour of a `lookup_host` function, mirroring other, public iterator-based features. And finally, I've simplified the parsing logic responsible for recognising IP addresses passed to `<(&str, u16)>::to_socket_addrs()` by using the `FromStr` impl of `IpAddr` rather than duplicating the parsing for both IP versions.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
