Skip to content

Commit 980e47f

Browse files
committed
mod.rs cleanups.
1 parent eac743e commit 980e47f

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

src/io/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,9 @@ pub use read_write::{pread, pwrite, read, readv, write, writev, IoSlice, IoSlice
6666
pub use read_write::{preadv, pwritev};
6767
#[cfg(any(target_os = "android", target_os = "linux"))]
6868
pub use read_write::{preadv2, pwritev2, ReadWriteFlags};
69-
#[cfg(not(windows))]
70-
pub use stdio::{stderr, stdin, stdout, take_stderr, take_stdin, take_stdout};
71-
7269
#[cfg(not(feature = "std"))]
7370
pub use seek_from::SeekFrom;
7471
#[cfg(feature = "std")]
7572
pub use std::io::SeekFrom;
73+
#[cfg(not(windows))]
74+
pub use stdio::{stderr, stdin, stdout, take_stderr, take_stdin, take_stdout};

src/net/mod.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ mod wsa;
2121

2222
pub mod sockopt;
2323

24-
#[cfg(unix)]
25-
pub use send_recv::sendto_unix;
2624
pub use send_recv::{
2725
recv, recvfrom, send, sendto, sendto_any, sendto_v4, sendto_v6, RecvFlags, SendFlags,
2826
};
@@ -31,18 +29,20 @@ pub use socket::{
3129
connect_any, connect_v4, connect_v6, getpeername, getsockname, listen, shutdown, socket,
3230
socket_with, AcceptFlags, AddressFamily, Protocol, Shutdown, SocketFlags, SocketType,
3331
};
34-
#[cfg(unix)]
35-
pub use socket::{bind_unix, connect_unix, SocketAddrUnix};
3632
pub use socket_addr_any::{SocketAddrAny, SocketAddrStorage};
3733
#[cfg(not(any(windows, target_os = "wasi")))]
3834
pub use socketpair::socketpair;
35+
#[cfg(feature = "std")]
36+
pub use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
3937
#[cfg(windows)]
4038
pub use wsa::{wsa_cleanup, wsa_startup};
41-
42-
// Declare the `Ip` and `Socket` address types.
43-
#[cfg(not(feature = "std"))]
44-
pub use addr::{SocketAddr, SocketAddrV4, SocketAddrV6};
4539
#[cfg(not(feature = "std"))]
46-
pub use ip::{IpAddr, Ipv4Addr, Ipv6Addr, Ipv6MulticastScope};
47-
#[cfg(feature = "std")]
48-
pub use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
40+
pub use {
41+
addr::{SocketAddr, SocketAddrV4, SocketAddrV6},
42+
ip::{IpAddr, Ipv4Addr, Ipv6Addr, Ipv6MulticastScope},
43+
};
44+
#[cfg(unix)]
45+
pub use {
46+
send_recv::sendto_unix,
47+
socket::{bind_unix, connect_unix, SocketAddrUnix},
48+
};

0 commit comments

Comments
 (0)