File tree Expand file tree Collapse file tree 3 files changed +12
-12
lines changed
library/std/src/os/windows Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 2929pub mod ffi;
3030pub mod fs;
3131pub mod io;
32+ pub mod net;
3233pub mod process;
3334pub mod raw;
3435pub mod thread;
35- pub mod net;
3636
3737/// A prelude for conveniently writing platform-specific code.
3838///
Original file line number Diff line number Diff line change 11#![ stable( feature = "rust1" , since = "1.0.0" ) ]
22
33use crate :: os:: raw:: { c_char, c_int} ;
4- use crate :: { io, mem} ;
5- use crate :: sys:: c;
64use crate :: path:: Path ;
5+ use crate :: sys:: c;
6+ use crate :: { io, mem} ;
77#[ stable( feature = "rust1" , since = "1.0.0" ) ]
8- pub fn sockaddr_un ( path : & Path ) -> io:: Result < ( c:: sockaddr_un , c_int ) > {
9- let mut addr: c:: sockaddr_un = unsafe { mem:: zeroed ( ) } ;
8+ pub fn sockaddr_un ( path : & Path ) -> io:: Result < ( c:: sockaddr_un , c_int ) > {
9+ let mut addr: c:: sockaddr_un = unsafe { mem:: zeroed ( ) } ;
1010 addr. sun_family = c:: AF_UNIX ;
1111 // Winsock2 expects 'sun_path' to be a Win32 UTF-8 file system path
12- let bytes = path. to_str ( ) . map ( |s| s . as_bytes ( ) ) . ok_or ( io :: Error :: new (
13- io :: ErrorKind :: InvalidInput ,
14- "path contains invalid characters" ,
15- ) ) ?;
12+ let bytes = path
13+ . to_str ( )
14+ . map ( |s| s . as_bytes ( ) )
15+ . ok_or ( io :: Error :: new ( io :: ErrorKind :: InvalidInput , "path contains invalid characters" ) ) ?;
1616
1717 if bytes. contains ( & 0 ) {
1818 return Err ( io:: Error :: new (
@@ -38,7 +38,7 @@ pub fn sockaddr_un(path: &Path)->io::Result<(c::sockaddr_un,c_int)>{
3838 Some ( & 0 ) | None => { }
3939 Some ( _) => len += 1 ,
4040 }
41- Ok ( ( addr, len as _ ) )
41+ Ok ( ( addr, len as _ ) )
4242}
4343fn sun_path_offset ( addr : & c:: sockaddr_un ) -> usize {
4444 // Work with an actual instance of the type since using a null pointer is UB
Original file line number Diff line number Diff line change 11#![ stable( feature = "rust1" , since = "1.0.0" ) ]
22
3- mod listener;
43mod addr;
4+ mod listener;
55#[ stable( feature = "rust1" , since = "1.0.0" ) ]
66pub use addr:: * ;
77#[ stable( feature = "rust1" , since = "1.0.0" ) ]
8- pub use listener:: * ;
8+ pub use listener:: * ;
You can’t perform that action at this time.
0 commit comments