16
16
#![ deny( missing_copy_implementations) ]
17
17
#![ deny( missing_debug_implementations) ]
18
18
19
+ // External crates
19
20
#[ macro_use]
20
21
extern crate bitflags;
21
-
22
22
#[ macro_use]
23
23
extern crate cfg_if;
24
24
extern crate void;
25
25
26
- #[ macro_use] mod macros;
27
-
26
+ // Re-exported external crates
28
27
pub extern crate libc;
29
28
30
- use errno:: Errno ;
29
+ // Private internal modules
30
+ #[ macro_use] mod macros;
31
31
32
+ // Public crates
32
33
pub mod errno;
33
34
#[ deny( missing_docs) ]
34
35
pub mod features;
35
36
pub mod fcntl;
36
-
37
37
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
38
38
pub mod mount;
39
-
40
39
#[ cfg( any( target_os = "dragonfly" ,
41
40
target_os = "freebsd" ,
42
41
target_os = "fushsia" ,
43
42
target_os = "linux" ,
44
43
target_os = "netbsd" ) ) ]
45
44
pub mod mqueue;
46
-
47
45
#[ deny( missing_docs) ]
48
- pub mod pty;
49
-
46
+ pub mod net;
50
47
#[ deny( missing_docs) ]
51
48
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" ) ) ]
63
49
#[ deny( missing_docs) ]
64
- pub mod ifaddrs;
65
-
50
+ pub mod pty;
66
51
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
67
52
pub mod sched;
68
-
69
53
pub mod sys;
70
-
71
54
// This can be implemented for other platforms as soon as libc
72
55
// provides bindings for them.
73
56
#[ cfg( all( target_os = "linux" ,
74
57
any( target_arch = "x86" , target_arch = "x86_64" ) ) ) ]
75
58
pub mod ucontext;
76
-
77
59
pub mod unistd;
78
60
79
61
/*
@@ -82,14 +64,14 @@ pub mod unistd;
82
64
*
83
65
*/
84
66
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} ;
87
70
use std:: ffi:: { CStr , OsStr } ;
88
- use std:: path:: { Path , PathBuf } ;
89
71
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 ;
93
75
94
76
/// Nix Result Type
95
77
pub type Result < T > = result:: Result < T , Error > ;
0 commit comments