Skip to content

Commit

Permalink
Fix tidy checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jD91mZM2 committed Jun 27, 2018
1 parent a4e1905 commit 79bf00f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
10 changes: 10 additions & 0 deletions 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::*;
10 changes: 6 additions & 4 deletions src/libstd/sys/unix/ext/net.rs
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion src/libstd/sys/unix/ext/unixsocket.rs
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/libstd/sys_common/mod.rs
Expand Up @@ -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"))] {
Expand Down
1 change: 0 additions & 1 deletion src/libstd/sys_common/unixsocket.rs
Expand Up @@ -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
Expand Down

0 comments on commit 79bf00f

Please sign in to comment.