rustix icon indicating copy to clipboard operation
rustix copied to clipboard

`impl FromStr for Ipv4Addr`

Open AsafFisher opened this issue 2 years ago • 2 comments

Is this required? I am thinking of moving the Parser here from the rust std... What do you think?

AsafFisher avatar Sep 08 '22 21:09 AsafFisher

Maybe use https://docs.rs/no-std-net/latest/no_std_net/struct.Ipv4Addr.html ?

AsafFisher avatar Sep 08 '22 21:09 AsafFisher

This only affects the no_std build, because in the std build, rustix's Ipv4Addr is just std::net::Ipv4Addr.

I think the reason I put these in rustix for the no_std build rather than just using a crate like no-std-net is to make it easier for the port of std to rustix. Using a crate as a dependency of std requires some trickery, and I'm still not sure if I'm doing it right in rustix, so I'm not confident in submitting changes to third-party crates to do it. If porting the code from std is straightforward, that might be the best approach for now.

This whole issue will hopefully go away in the future; https://github.com/rust-lang/rust/pull/78802 hopefully opens up a path to moving these types into actual core, which should eliminate all these issues.

sunfishcode avatar Sep 08 '22 23:09 sunfishcode