Skip to content

Commit 33a00f3

Browse files
author
Bryant Mairs
committed
Clean up imports and uses in lib.rs
1 parent 7ff9595 commit 33a00f3

File tree

1 file changed

+13
-31
lines changed

1 file changed

+13
-31
lines changed

src/lib.rs

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,64 +16,46 @@
1616
#![deny(missing_copy_implementations)]
1717
#![deny(missing_debug_implementations)]
1818

19+
// External crates
1920
#[macro_use]
2021
extern crate bitflags;
21-
2222
#[macro_use]
2323
extern crate cfg_if;
2424
extern crate void;
2525

26-
#[macro_use] mod macros;
27-
26+
// Re-exported external crates
2827
pub extern crate libc;
2928

30-
use errno::Errno;
29+
// Private internal modules
30+
#[macro_use] mod macros;
3131

32+
// Public crates
3233
pub mod errno;
3334
#[deny(missing_docs)]
3435
pub mod features;
3536
pub mod fcntl;
36-
3737
#[cfg(any(target_os = "linux", target_os = "android"))]
3838
pub mod mount;
39-
4039
#[cfg(any(target_os = "dragonfly",
4140
target_os = "freebsd",
4241
target_os = "fushsia",
4342
target_os = "linux",
4443
target_os = "netbsd"))]
4544
pub mod mqueue;
46-
4745
#[deny(missing_docs)]
48-
pub mod pty;
49-
46+
pub mod net;
5047
#[deny(missing_docs)]
5148
pub mod poll;
52-
53-
#[deny(missing_docs)]
54-
pub mod net;
55-
56-
#[cfg(any(target_os = "dragonfly",
57-
target_os = "freebsd",
58-
target_os = "ios",
59-
target_os = "linux",
60-
target_os = "macos",
61-
target_os = "netbsd",
62-
target_os = "openbsd"))]
6349
#[deny(missing_docs)]
64-
pub mod ifaddrs;
65-
50+
pub mod pty;
6651
#[cfg(any(target_os = "linux", target_os = "android"))]
6752
pub mod sched;
68-
6953
pub mod sys;
70-
7154
// This can be implemented for other platforms as soon as libc
7255
// provides bindings for them.
7356
#[cfg(all(target_os = "linux",
7457
any(target_arch = "x86", target_arch = "x86_64")))]
7558
pub mod ucontext;
76-
7759
pub mod unistd;
7860

7961
/*
@@ -82,14 +64,14 @@ pub mod unistd;
8264
*
8365
*/
8466

85-
use libc::c_char;
86-
use std::{ptr, result};
67+
use libc::{c_char, PATH_MAX};
68+
69+
use std::{error, fmt, ptr, result};
8770
use std::ffi::{CStr, OsStr};
88-
use std::path::{Path, PathBuf};
8971
use std::os::unix::ffi::OsStrExt;
90-
use std::fmt;
91-
use std::error;
92-
use libc::PATH_MAX;
72+
use std::path::{Path, PathBuf};
73+
74+
use errno::Errno;
9375

9476
/// Nix Result Type
9577
pub type Result<T> = result::Result<T, Error>;

0 commit comments

Comments
 (0)