We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e60aa62 commit 40053a4Copy full SHA for 40053a4
src/libstd/net/ip.rs
@@ -524,6 +524,18 @@ impl fmt::Display for IpAddr {
524
}
525
526
527
+impl From<Ipv4Addr> for IpAddr {
528
+ fn from(ipv4: Ipv4Addr) -> IpAddr {
529
+ IpAddr::V4(ipv4)
530
+ }
531
+}
532
+
533
+impl From<Ipv6Addr> for IpAddr {
534
+ fn from(ipv6: Ipv6Addr) -> IpAddr {
535
+ IpAddr::V6(ipv6)
536
537
538
539
#[stable(feature = "rust1", since = "1.0.0")]
540
impl fmt::Display for Ipv4Addr {
541
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
0 commit comments