Skip to content

Commit b45c505

Browse files
Alexander Polakovkamalmarhubi
Alexander Polakov
authored andcommitted
Fix style suggestions regarding #cfg
as pointed out by @kamalmarhubi
1 parent 9eccfc2 commit b45c505

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/sys/socket/addr.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub enum AddressFamily {
3232
Unix = consts::AF_UNIX,
3333
Inet = consts::AF_INET,
3434
Inet6 = consts::AF_INET6,
35-
#[cfg(any(target_os = "linux", target_os = "android"))]
35+
#[cfg(any(target_os = "linux", target_os = "android"))]
3636
Netlink = consts::AF_NETLINK,
3737
}
3838

@@ -464,7 +464,7 @@ impl fmt::Display for UnixAddr {
464464
pub enum SockAddr {
465465
Inet(InetAddr),
466466
Unix(UnixAddr),
467-
#[cfg(any(target_os = "linux", target_os = "android"))]
467+
#[cfg(any(target_os = "linux", target_os = "android"))]
468468
Netlink(NetlinkAddr)
469469
}
470470

@@ -477,7 +477,7 @@ impl SockAddr {
477477
Ok(SockAddr::Unix(try!(UnixAddr::new(path))))
478478
}
479479

480-
#[cfg(any(target_os = "linux", target_os = "android"))]
480+
#[cfg(any(target_os = "linux", target_os = "android"))]
481481
pub fn new_netlink(pid: u32, groups: u32) -> SockAddr {
482482
SockAddr::Netlink(NetlinkAddr::new(pid, groups))
483483
}
@@ -487,7 +487,7 @@ impl SockAddr {
487487
SockAddr::Inet(InetAddr::V4(..)) => AddressFamily::Inet,
488488
SockAddr::Inet(InetAddr::V6(..)) => AddressFamily::Inet6,
489489
SockAddr::Unix(..) => AddressFamily::Unix,
490-
#[cfg(any(target_os = "linux", target_os = "android"))]
490+
#[cfg(any(target_os = "linux", target_os = "android"))]
491491
SockAddr::Netlink(..) => AddressFamily::Netlink,
492492
}
493493
}
@@ -501,7 +501,7 @@ impl SockAddr {
501501
SockAddr::Inet(InetAddr::V4(ref addr)) => (mem::transmute(addr), mem::size_of::<libc::sockaddr_in>() as libc::socklen_t),
502502
SockAddr::Inet(InetAddr::V6(ref addr)) => (mem::transmute(addr), mem::size_of::<libc::sockaddr_in6>() as libc::socklen_t),
503503
SockAddr::Unix(UnixAddr(ref addr, len)) => (mem::transmute(addr), (len + mem::size_of::<libc::sa_family_t>()) as libc::socklen_t),
504-
#[cfg(any(target_os = "linux", target_os = "android"))]
504+
#[cfg(any(target_os = "linux", target_os = "android"))]
505505
SockAddr::Netlink(NetlinkAddr(ref sa)) => (mem::transmute(sa), mem::size_of::<sockaddr_nl>() as libc::socklen_t),
506506
}
507507
}
@@ -516,7 +516,7 @@ impl PartialEq for SockAddr {
516516
(SockAddr::Unix(ref a), SockAddr::Unix(ref b)) => {
517517
a == b
518518
}
519-
#[cfg(any(target_os = "linux", target_os = "android"))]
519+
#[cfg(any(target_os = "linux", target_os = "android"))]
520520
(SockAddr::Netlink(ref a), SockAddr::Netlink(ref b)) => {
521521
a == b
522522
}
@@ -533,7 +533,7 @@ impl hash::Hash for SockAddr {
533533
match *self {
534534
SockAddr::Inet(ref a) => a.hash(s),
535535
SockAddr::Unix(ref a) => a.hash(s),
536-
#[cfg(any(target_os = "linux", target_os = "android"))]
536+
#[cfg(any(target_os = "linux", target_os = "android"))]
537537
SockAddr::Netlink(ref a) => a.hash(s),
538538
}
539539
}
@@ -550,7 +550,7 @@ impl fmt::Display for SockAddr {
550550
match *self {
551551
SockAddr::Inet(ref inet) => inet.fmt(f),
552552
SockAddr::Unix(ref unix) => unix.fmt(f),
553-
#[cfg(any(target_os = "linux", target_os = "android"))]
553+
#[cfg(any(target_os = "linux", target_os = "android"))]
554554
SockAddr::Netlink(ref nl) => nl.fmt(f),
555555
}
556556
}

0 commit comments

Comments
 (0)