Skip to content

Commit dd4555d

Browse files
committed
fmt
1 parent 589d178 commit dd4555d

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

library/std/src/os/windows/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
pub mod ffi;
3030
pub mod fs;
3131
pub mod io;
32+
pub mod net;
3233
pub mod process;
3334
pub mod raw;
3435
pub mod thread;
35-
pub mod net;
3636

3737
/// A prelude for conveniently writing platform-specific code.
3838
///

library/std/src/os/windows/net/addr.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#![stable(feature = "rust1", since = "1.0.0")]
22

33
use crate::os::raw::{c_char, c_int};
4-
use crate::{io, mem};
5-
use crate::sys::c;
64
use 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
}
4343
fn sun_path_offset(addr: &c::sockaddr_un) -> usize {
4444
// Work with an actual instance of the type since using a null pointer is UB
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#![stable(feature = "rust1", since = "1.0.0")]
22

3-
mod listener;
43
mod addr;
4+
mod listener;
55
#[stable(feature = "rust1", since = "1.0.0")]
66
pub use addr::*;
77
#[stable(feature = "rust1", since = "1.0.0")]
8-
pub use listener::*;
8+
pub use listener::*;

0 commit comments

Comments
 (0)