about summary refs log tree commit diff
path: root/src/libstd/sys
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 /src/libstd/sys
parenta4e190546c9aaa06630577adb7310a8674bbac06 (diff)
Fix tidy checks
Diffstat (limited to 'src/libstd/sys')
-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
3 files changed, 19 insertions, 5 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