summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryant Mairs <bryantmairs@google.com>2018-01-14 11:35:36 -0800
committerBryant Mairs <bryantmairs@google.com>2018-01-28 17:39:12 -0800
commitd1be45d8405c98f8f9c222cf004de46e8685826e (patch)
treed0dd35a372e1d2766f49b9479292da12227522b8
parent29eca60c18cab1c02479b72cc3215a7c9cd5921f (diff)
downloadnix-d1be45d8405c98f8f9c222cf004de46e8685826e.zip
Clean up imports and uses in lib.rs
-rw-r--r--src/lib.rs44
1 files 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<T> = result::Result<T, Error>;