From 79bf00f4063793b3828001a845f6111d628c3349 Mon Sep 17 00:00:00 2001 From: jD91mZM2 Date: Wed, 27 Jun 2018 14:52:08 +0200 Subject: Fix tidy checks --- src/libstd/sys/redox/ext/net.rs | 10 ++++++++++ src/libstd/sys/unix/ext/net.rs | 10 ++++++---- src/libstd/sys/unix/ext/unixsocket.rs | 4 +++- 3 files changed, 19 insertions(+), 5 deletions(-) (limited to 'src/libstd/sys') 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 or the MIT license +// , 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 { - 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 { - 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 { + pub(crate) fn from_parts(addr: libc::sockaddr_un, mut len: libc::socklen_t) + -> io::Result + { if len == 0 { // When there is a datagram from unnamed unix socket // linux returns zero bytes of address -- cgit 1.4.1-3-g733a5