From 783aa2e4bb9f19c8894d9f7fb52f6f4d3d044a6d Mon Sep 17 00:00:00 2001 From: rabbott99 Date: Tue, 9 Apr 2019 13:48:38 -0400 Subject: [PATCH] Uncomment to_std and from_std methods for IpAddr --- CHANGELOG.md | 1 + src/sys/socket/addr.rs | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28d5bd16b5..cc15db519a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ([#969](https://github.com/nix-rust/nix/pull/969)) - Add several errno constants from OpenBSD 6.2 ([#1036](https://github.com/nix-rust/nix/pull/1036)) +- Added `from_std` and `to_std` methods for `sys::socket::IpAddr` ### Changed - `PollFd` event flags renamed to `PollFlags` ([#1024](https://github.com/nix-rust/nix/pull/1024/)) diff --git a/src/sys/socket/addr.rs b/src/sys/socket/addr.rs index 13459e9b18..f0393f89a8 100644 --- a/src/sys/socket/addr.rs +++ b/src/sys/socket/addr.rs @@ -418,20 +418,19 @@ impl IpAddr { IpAddr::V6(Ipv6Addr::new(a, b, c, d, e, f, g, h)) } - /* pub fn from_std(std: &net::IpAddr) -> IpAddr { match *std { net::IpAddr::V4(ref std) => IpAddr::V4(Ipv4Addr::from_std(std)), net::IpAddr::V6(ref std) => IpAddr::V6(Ipv6Addr::from_std(std)), } } + pub fn to_std(&self) -> net::IpAddr { match *self { IpAddr::V4(ref ip) => net::IpAddr::V4(ip.to_std()), IpAddr::V6(ref ip) => net::IpAddr::V6(ip.to_std()), } } - */ } impl fmt::Display for IpAddr {