Files
rust/tests/ui/inference
Stuart Cook ff8d63ae43 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.
2025-09-19 22:31:51 +10:00
..
2025-02-14 00:37:23 +01:00
2025-07-25 20:38:54 +05:00
2025-07-25 20:38:54 +05:00
2024-03-03 16:30:48 -03:00
2024-02-13 18:08:25 -03:00
2025-02-03 10:39:32 -05:00
2025-09-19 11:30:27 +02:00
2025-09-19 11:30:27 +02:00
2025-08-09 16:27:20 +05:00
2025-08-05 19:34:46 +05:00
2025-08-09 16:27:20 +05:00
2024-02-29 08:46:00 +08:00
2024-02-29 08:46:00 +08:00