From d1be45d8405c98f8f9c222cf004de46e8685826e Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Sun, 14 Jan 2018 11:35:36 -0800 Subject: Clean up imports and uses in lib.rs --- src/lib.rs | 44 +++++++++++++------------------------------- 1 file changed, 13 insertions(+), 31 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 29d0cbac..e3ce81b8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,65 +16,47 @@ #![deny(missing_copy_implementations)] #![deny(missing_debug_implementations)] +// External crates extern crate bytes; #[macro_use] extern crate bitflags; - #[macro_use] extern crate cfg_if; extern crate void; -#[macro_use] mod macros; - +// Re-exported external crates pub extern crate libc; -use errno::Errno; +// Private internal modules +#[macro_use] mod macros; +// Public crates pub mod errno; #[deny(missing_docs)] pub mod features; pub mod fcntl; - #[cfg(any(target_os = "linux", target_os = "android"))] pub mod mount; - #[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "fushsia", target_os = "linux", target_os = "netbsd"))] pub mod mqueue; - #[deny(missing_docs)] -pub mod pty; - +pub mod net; #[deny(missing_docs)] pub mod poll; - -#[deny(missing_docs)] -pub mod net; - -#[cfg(any(target_os = "dragonfly", - target_os = "freebsd", - target_os = "ios", - target_os = "linux", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd"))] #[deny(missing_docs)] -pub mod ifaddrs; - +pub mod pty; #[cfg(any(target_os = "linux", target_os = "android"))] pub mod sched; - pub mod sys; - // This can be implemented for other platforms as soon as libc // provides bindings for them. #[cfg(all(target_os = "linux", any(target_arch = "x86", target_arch = "x86_64")))] pub mod ucontext; - pub mod unistd; /* @@ -83,14 +65,14 @@ pub mod unistd; * */ -use libc::c_char; -use std::{ptr, result}; +use libc::{c_char, PATH_MAX}; + +use std::{error, fmt, ptr, result}; use std::ffi::{CStr, OsStr}; -use std::path::{Path, PathBuf}; use std::os::unix::ffi::OsStrExt; -use std::fmt; -use std::error; -use libc::PATH_MAX; +use std::path::{Path, PathBuf}; + +use errno::Errno; /// Nix Result Type pub type Result = result::Result; -- cgit v1.2.3