Add a way to parse IP addresses without having to utf8-validate · Issue #94821 · rust-lang/rust (original) (raw)

The only standard way I've found to parse an IP address is IpAddr::from_str. That function immediately converts the string to bytes:

rust/library/std/src/net/parser.rs

Line 44 in5f4e067

Parser { state: input.as_bytes() }

It would be great to expose some way (not necessarily Parser::new, but something similar) that doesn't require doing unnecessary utf8 validation.

@rustbot label: +T-libs +C-enhancement