about summary refs log tree commit diff
diff options
context:
space:
mode:
authorjD91mZM2 <me@krake.one>2018-06-27 14:52:08 +0200
committerjD91mZM2 <me@krake.one>2018-06-27 15:10:00 +0200
commit79bf00f4063793b3828001a845f6111d628c3349 (patch)
treebda814fe93c7e89adbc05e56520c443bb0c4e477
parenta4e190546c9aaa06630577adb7310a8674bbac06 (diff)
downloadrust-79bf00f4063793b3828001a845f6111d628c3349.tar.gz
rust-79bf00f4063793b3828001a845f6111d628c3349.zip
Fix tidy checks
-rw-r--r--src/libstd/sys/redox/ext/net.rs10
-rw-r--r--src/libstd/sys/unix/ext/net.rs10
-rw-r--r--src/libstd/sys/unix/ext/unixsocket.rs4
-rw-r--r--src/libstd/sys_common/mod.rs4
-rw-r--r--src/libstd/sys_common/unixsocket.rs1
5 files changed, 22 insertions, 7 deletions
diff --git a/src/libstd/sys/redox/ext/net.rs b/src/libstd/sys/redox/ext/net.rs
index eb256885155..16eec67fb87 100644
--- a/src/libstd/sys/redox/ext/net.rs
+++ b/src/libstd/sys/redox/ext/net.rs
@@ -1,3 +1,13 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
 #![stable(feature = "unix_socket", since = "1.10.0")]
 #[stable(feature = "unix_socket", since = "1.10.0")]
 pub use sys_common::unixsocket::*;
diff --git a/src/libstd/sys/unix/ext/net.rs b/src/libstd/sys/unix/ext/net.rs
index 77bca85fe88..9251871baf6 100644
--- a/src/libstd/sys/unix/ext/net.rs
+++ b/src/libstd/sys/unix/ext/net.rs
@@ -323,8 +323,9 @@ impl UnixDatagram {
     /// ```
     #[stable(feature = "unix_socket", since = "1.10.0")]
     pub fn local_addr(&self) -> io::Result<SocketAddr> {
-        inner::SocketAddr::new(|addr, len| unsafe { libc::getsockname(*self.0.as_inner(), addr, len) })
-            .map(SocketAddr)
+        inner::SocketAddr::new(|addr, len| unsafe {
+            libc::getsockname(*self.0.as_inner(), addr, len)
+        }).map(SocketAddr)
     }
 
     /// Returns the address of this socket's peer.
@@ -345,8 +346,9 @@ impl UnixDatagram {
     /// ```
     #[stable(feature = "unix_socket", since = "1.10.0")]
     pub fn peer_addr(&self) -> io::Result<SocketAddr> {
-        inner::SocketAddr::new(|addr, len| unsafe { libc::getsockname(*self.0.as_inner(), addr, len) })
-            .map(SocketAddr)
+        inner::SocketAddr::new(|addr, len| unsafe {
+            libc::getsockname(*self.0.as_inner(), addr, len)
+        }).map(SocketAddr)
     }
 
     /// Receives data from the socket.
diff --git a/src/libstd/sys/unix/ext/unixsocket.rs b/src/libstd/sys/unix/ext/unixsocket.rs
index f6996ecd66f..7b52a5fcf0d 100644
--- a/src/libstd/sys/unix/ext/unixsocket.rs
+++ b/src/libstd/sys/unix/ext/unixsocket.rs
@@ -65,7 +65,9 @@ impl SocketAddr {
         }
     }
 
-    pub(crate) fn from_parts(addr: libc::sockaddr_un, mut len: libc::socklen_t) -> io::Result<SocketAddr> {
+    pub(crate) fn from_parts(addr: libc::sockaddr_un, mut len: libc::socklen_t)
+        -> io::Result<SocketAddr>
+    {
         if len == 0 {
             // When there is a datagram from unnamed unix socket
             // linux returns zero bytes of address
diff --git a/src/libstd/sys_common/mod.rs b/src/libstd/sys_common/mod.rs
index 7fb273826cc..89f5fd79f40 100644
--- a/src/libstd/sys_common/mod.rs
+++ b/src/libstd/sys_common/mod.rs
@@ -54,7 +54,9 @@ pub mod util;
 pub mod wtf8;
 pub mod bytestring;
 pub mod process;
-pub mod unixsocket;
+
+#[cfg(any(all(unix, not(target_os = "emscripten")), target_os = "redox"))]
+pub(crate) mod unixsocket;
 
 cfg_if! {
     if #[cfg(any(target_os = "cloudabi", target_os = "l4re", target_os = "redox"))] {
diff --git a/src/libstd/sys_common/unixsocket.rs b/src/libstd/sys_common/unixsocket.rs
index 96037d6c5d9..286e0e9f37f 100644
--- a/src/libstd/sys_common/unixsocket.rs
+++ b/src/libstd/sys_common/unixsocket.rs
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![cfg(any(all(unix, not(target_os = "emscripten")), target_os = "redox"))]
 #![stable(feature = "unix_socket", since = "1.10.0")]
 
 //! Unix-specific networking functionality