Skip to content

Commit 783aa2e

Browse files
committed
Uncomment to_std and from_std methods for IpAddr
1 parent 0059ddf commit 783aa2e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1717
([#969](https://github.com/nix-rust/nix/pull/969))
1818
- Add several errno constants from OpenBSD 6.2
1919
([#1036](https://github.com/nix-rust/nix/pull/1036))
20+
- Added `from_std` and `to_std` methods for `sys::socket::IpAddr`
2021

2122
### Changed
2223
- `PollFd` event flags renamed to `PollFlags` ([#1024](https://github.com/nix-rust/nix/pull/1024/))

src/sys/socket/addr.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -418,20 +418,19 @@ impl IpAddr {
418418
IpAddr::V6(Ipv6Addr::new(a, b, c, d, e, f, g, h))
419419
}
420420

421-
/*
422421
pub fn from_std(std: &net::IpAddr) -> IpAddr {
423422
match *std {
424423
net::IpAddr::V4(ref std) => IpAddr::V4(Ipv4Addr::from_std(std)),
425424
net::IpAddr::V6(ref std) => IpAddr::V6(Ipv6Addr::from_std(std)),
426425
}
427426
}
427+
428428
pub fn to_std(&self) -> net::IpAddr {
429429
match *self {
430430
IpAddr::V4(ref ip) => net::IpAddr::V4(ip.to_std()),
431431
IpAddr::V6(ref ip) => net::IpAddr::V6(ip.to_std()),
432432
}
433433
}
434-
*/
435434
}
436435

437436
impl fmt::Display for IpAddr {

0 commit comments

Comments
 (0)