Open
Description
from_str
is implemented like so:
rust/library/std/src/net/parser.rs
Lines 226 to 229 in 5f4e067
This unnecessarily penalizes ipv6 addresses, because the parser will always do a full linear scan of the input before it even starts to parse the address. Instead, it could use the knowledge that IPv4 addresses are at most 15 bytes long to skip directly to
read_ipv6_addr
for longer strings.
@rustbot label: +I-slow +T-libs +C-enhancement