chore: apply unreachable_pub and missing_debug_implementations to all crates (#1424)

This commit is contained in:
Taiki Endo
2019-08-11 04:28:52 +09:00
committed by GitHub
parent d9f9c5658f
commit 6a125082e4
49 changed files with 322 additions and 225 deletions
+6 -1
View File
@@ -1,6 +1,11 @@
#![cfg(unix)]
#![doc(html_root_url = "https://docs.rs/tokio-uds/0.3.0-alpha.1")]
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
#![warn(
missing_debug_implementations,
missing_docs,
rust_2018_idioms,
unreachable_pub
)]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
#![feature(async_await)]
+9 -9
View File
@@ -10,7 +10,7 @@ pub struct UCred {
}
#[cfg(any(target_os = "linux", target_os = "android"))]
pub use self::impl_linux::get_peer_cred;
pub(crate) use self::impl_linux::get_peer_cred;
#[cfg(any(
target_os = "dragonfly",
@@ -20,20 +20,20 @@ pub use self::impl_linux::get_peer_cred;
target_os = "netbsd",
target_os = "openbsd"
))]
pub use self::impl_macos::get_peer_cred;
pub(crate) use self::impl_macos::get_peer_cred;
#[cfg(any(target_os = "solaris"))]
pub use self::impl_solaris::get_peer_cred;
pub(crate) use self::impl_solaris::get_peer_cred;
#[cfg(any(target_os = "linux", target_os = "android"))]
pub mod impl_linux {
pub(crate) mod impl_linux {
use crate::UnixStream;
use libc::{c_void, getsockopt, socklen_t, SOL_SOCKET, SO_PEERCRED};
use std::{io, mem};
use libc::ucred;
pub fn get_peer_cred(sock: &UnixStream) -> io::Result<super::UCred> {
pub(crate) fn get_peer_cred(sock: &UnixStream) -> io::Result<super::UCred> {
use std::os::unix::io::AsRawFd;
unsafe {
@@ -80,14 +80,14 @@ pub mod impl_linux {
target_os = "netbsd",
target_os = "openbsd"
))]
pub mod impl_macos {
pub(crate) mod impl_macos {
use crate::UnixStream;
use libc::getpeereid;
use std::io;
use std::mem::MaybeUninit;
use std::os::unix::io::AsRawFd;
pub fn get_peer_cred(sock: &UnixStream) -> io::Result<super::UCred> {
pub(crate) fn get_peer_cred(sock: &UnixStream) -> io::Result<super::UCred> {
unsafe {
let raw_fd = sock.as_raw_fd();
@@ -109,7 +109,7 @@ pub mod impl_macos {
}
#[cfg(any(target_os = "solaris"))]
pub mod impl_solaris {
pub(crate) mod impl_solaris {
use std::io;
use std::os::unix::io::AsRawFd;
use std::ptr;
@@ -129,7 +129,7 @@ pub mod impl_solaris {
) -> ::std::os::raw::c_int;
}
pub fn get_peer_cred(sock: &UnixStream) -> io::Result<super::UCred> {
pub(crate) fn get_peer_cred(sock: &UnixStream) -> io::Result<super::UCred> {
unsafe {
let raw_fd = sock.as_raw_fd();