summaryrefslogtreecommitdiff
path: root/src/ifaddrs.rs
diff options
context:
space:
mode:
authorluozijun <gnulinux@126.com>2017-12-28 03:10:44 +0800
committerluozijun <gnulinux@126.com>2018-01-08 11:49:13 +0800
commit7f7266d5a64d5a79506a883efbaaed977cb56aa7 (patch)
tree65e24f12e3f56c20e37381385d362cafb3081821 /src/ifaddrs.rs
parentabd72be1cc0dd064bdc2d77bd09488f67ca28203 (diff)
downloadnix-7f7266d5a64d5a79506a883efbaaed977cb56aa7.zip
impl `Debug` for all sockaddr types
Diffstat (limited to 'src/ifaddrs.rs')
-rw-r--r--src/ifaddrs.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/ifaddrs.rs b/src/ifaddrs.rs
index 2b3024b5..61d36ff4 100644
--- a/src/ifaddrs.rs
+++ b/src/ifaddrs.rs
@@ -4,7 +4,6 @@
//! of interfaces and their associated addresses.
use std::ffi;
-use std::fmt;
use std::iter::Iterator;
use std::mem;
use std::option::Option;
@@ -16,7 +15,7 @@ use sys::socket::SockAddr;
use net::if_::*;
/// Describes a single address for an interface as returned by `getifaddrs`.
-#[derive(Clone, Eq, Hash, PartialEq)]
+#[derive(Clone, Eq, Hash, PartialEq, Debug)]
pub struct InterfaceAddress {
/// Name of the network interface
pub interface_name: String,
@@ -32,12 +31,6 @@ pub struct InterfaceAddress {
pub destination: Option<SockAddr>,
}
-impl fmt::Debug for InterfaceAddress {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "InterfaceAddress ({:?})", self.interface_name)
- }
-}
-
cfg_if! {
if #[cfg(any(target_os = "emscripten", target_os = "fuchsia", target_os = "linux"))] {
fn get_ifu_from_sockaddr(info: &libc::ifaddrs) -> *const libc::sockaddr {