summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrabbott99 <rabbott4927@gmail.com>2019-04-09 13:48:38 -0400
committerrabbott99 <rabbott4927@gmail.com>2019-04-09 14:31:52 -0400
commit9f7deb1382c449bc5570f16138e4bc96d0d2a2ea (patch)
treefa8d5e4d2ef0a3bdad0eea7301c93d35cbc66ed1
parent0059ddf435005c04e2caeb3dd0313d317a56e000 (diff)
downloadnix-9f7deb1382c449bc5570f16138e4bc96d0d2a2ea.zip
Uncomment to_std and from_std methods for IpAddr
-rw-r--r--CHANGELOG.md2
-rw-r--r--src/sys/socket/addr.rs3
2 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 28d5bd16..bddfb522 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,6 +17,8 @@ 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`
+ ([#1043](https://github.com/nix-rust/nix/pull/1043))
### 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 13459e9b..f0393f89 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 {