Skip to content

Commit 179bcb5

Browse files
bors[bot]rabbott99
andcommitted
Merge #1043
1043: Uncomment to_std and from_std methods for IpAddr r=asomers a=rabbott99 These were commented out in 2b60633, apparently because `std::net::IpAddr` had been removed from the standard library. However, `IpAddr` has since been re-added to the standard library (rust-lang/rust#23711) and stabilized (rust-lang/rust#31438), so it seems there is no reason to keep them commented out. Co-authored-by: rabbott99 <[email protected]>
2 parents 0059ddf + 9f7deb1 commit 179bcb5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ 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`
21+
([#1043](https://github.com/nix-rust/nix/pull/1043))
2022

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

src/sys/socket/addr.rs

Lines changed: 1 addition & 2 deletions
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)