@@ -21,8 +21,6 @@ mod wsa;
2121
2222pub mod sockopt;
2323
24- #[ cfg( unix) ]
25- pub use send_recv:: sendto_unix;
2624pub 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 } ;
3632pub use socket_addr_any:: { SocketAddrAny , SocketAddrStorage } ;
3733#[ cfg( not( any( windows, target_os = "wasi" ) ) ) ]
3834pub use socketpair:: socketpair;
35+ #[ cfg( feature = "std" ) ]
36+ pub use std:: net:: { IpAddr , Ipv4Addr , Ipv6Addr , SocketAddr , SocketAddrV4 , SocketAddrV6 } ;
3937#[ cfg( windows) ]
4038pub 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