Skip to content

Commit 79bf00f

Browse files
committed
Fix tidy checks
1 parent a4e1905 commit 79bf00f

File tree

5 files changed

+22
-7
lines changed

5 files changed

+22
-7
lines changed

src/libstd/sys/redox/ext/net.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
#![stable(feature = "unix_socket", since = "1.10.0")]
212
#[stable(feature = "unix_socket", since = "1.10.0")]
313
pub use sys_common::unixsocket::*;

src/libstd/sys/unix/ext/net.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,9 @@ impl UnixDatagram {
323323
/// ```
324324
#[stable(feature = "unix_socket", since = "1.10.0")]
325325
pub fn local_addr(&self) -> io::Result<SocketAddr> {
326-
inner::SocketAddr::new(|addr, len| unsafe { libc::getsockname(*self.0.as_inner(), addr, len) })
327-
.map(SocketAddr)
326+
inner::SocketAddr::new(|addr, len| unsafe {
327+
libc::getsockname(*self.0.as_inner(), addr, len)
328+
}).map(SocketAddr)
328329
}
329330

330331
/// Returns the address of this socket's peer.
@@ -345,8 +346,9 @@ impl UnixDatagram {
345346
/// ```
346347
#[stable(feature = "unix_socket", since = "1.10.0")]
347348
pub fn peer_addr(&self) -> io::Result<SocketAddr> {
348-
inner::SocketAddr::new(|addr, len| unsafe { libc::getsockname(*self.0.as_inner(), addr, len) })
349-
.map(SocketAddr)
349+
inner::SocketAddr::new(|addr, len| unsafe {
350+
libc::getsockname(*self.0.as_inner(), addr, len)
351+
}).map(SocketAddr)
350352
}
351353

352354
/// Receives data from the socket.

src/libstd/sys/unix/ext/unixsocket.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ impl SocketAddr {
6565
}
6666
}
6767

68-
pub(crate) fn from_parts(addr: libc::sockaddr_un, mut len: libc::socklen_t) -> io::Result<SocketAddr> {
68+
pub(crate) fn from_parts(addr: libc::sockaddr_un, mut len: libc::socklen_t)
69+
-> io::Result<SocketAddr>
70+
{
6971
if len == 0 {
7072
// When there is a datagram from unnamed unix socket
7173
// linux returns zero bytes of address

src/libstd/sys_common/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ pub mod util;
5454
pub mod wtf8;
5555
pub mod bytestring;
5656
pub mod process;
57-
pub mod unixsocket;
57+
58+
#[cfg(any(all(unix, not(target_os = "emscripten")), target_os = "redox"))]
59+
pub(crate) mod unixsocket;
5860

5961
cfg_if! {
6062
if #[cfg(any(target_os = "cloudabi", target_os = "l4re", target_os = "redox"))] {

src/libstd/sys_common/unixsocket.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![cfg(any(all(unix, not(target_os = "emscripten")), target_os = "redox"))]
1211
#![stable(feature = "unix_socket", since = "1.10.0")]
1312

1413
//! Unix-specific networking functionality

0 commit comments

Comments
 (0)