diff options
| author | David Tolnay <dtolnay@gmail.com> | 2019-11-27 10:28:39 -0800 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2019-11-29 18:37:58 -0800 |
| commit | c34fbfaad38cf5829ef5cfe780dc9d58480adeaa (patch) | |
| tree | e57b66ed06aec18dc13ff7f14a243ca3dc3c27d1 /src/libstd/sys/vxworks/mod.rs | |
| parent | 9081929d45f12d3f56d43b1d6db7519981580fc9 (diff) | |
| download | rust-c34fbfaad38cf5829ef5cfe780dc9d58480adeaa.tar.gz rust-c34fbfaad38cf5829ef5cfe780dc9d58480adeaa.zip | |
Format libstd/sys with rustfmt
This commit applies rustfmt with rust-lang/rust's default settings to
files in src/libstd/sys *that are not involved in any currently open PR*
to minimize merge conflicts. THe list of files involved in open PRs was
determined by querying GitHub's GraphQL API with this script:
https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8
With the list of files from the script in outstanding_files, the
relevant commands were:
$ find src/libstd/sys -name '*.rs' \
| xargs rustfmt --edition=2018 --unstable-features --skip-children
$ rg libstd/sys outstanding_files | xargs git checkout --
Repeating this process several months apart should get us coverage of
most of the rest of the files.
To confirm no funny business:
$ git checkout $THIS_COMMIT^
$ git show --pretty= --name-only $THIS_COMMIT \
| xargs rustfmt --edition=2018 --unstable-features --skip-children
$ git diff $THIS_COMMIT # there should be no difference
Diffstat (limited to 'src/libstd/sys/vxworks/mod.rs')
| -rw-r--r-- | src/libstd/sys/vxworks/mod.rs | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/libstd/sys/vxworks/mod.rs b/src/libstd/sys/vxworks/mod.rs index 1eff4fbcd83..f102e4d6adf 100644 --- a/src/libstd/sys/vxworks/mod.rs +++ b/src/libstd/sys/vxworks/mod.rs @@ -3,8 +3,8 @@ use crate::io::ErrorKind; -pub use crate::os::vxworks as platform; pub use self::rand::hashmap_random_keys; +pub use crate::os::vxworks as platform; pub use libc::strlen; pub mod alloc; @@ -16,8 +16,8 @@ pub mod ext; pub mod fast_thread_local; pub mod fd; pub mod fs; -pub mod memchr; pub mod io; +pub mod memchr; pub mod mutex; pub mod net; pub mod os; @@ -27,10 +27,10 @@ pub mod process; pub mod rand; pub mod rwlock; pub mod stack_overflow; +pub mod stdio; pub mod thread; pub mod thread_local; pub mod time; -pub mod stdio; pub use crate::sys_common::os_str_bytes as os_str; @@ -47,7 +47,7 @@ pub fn init() { reset_sigpipe(); } - unsafe fn reset_sigpipe() { } + unsafe fn reset_sigpipe() {} } pub use libc::signal; @@ -71,8 +71,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind { // These two constants can have the same value on some systems, // but different values on others, so we can't use a match // clause - x if x == libc::EAGAIN || x == libc::EWOULDBLOCK => - ErrorKind::WouldBlock, + x if x == libc::EAGAIN || x == libc::EWOULDBLOCK => ErrorKind::WouldBlock, _ => ErrorKind::Other, } @@ -94,16 +93,13 @@ macro_rules! impl_is_minus_one { impl_is_minus_one! { i8 i16 i32 i64 isize } pub fn cvt<T: IsMinusOne>(t: T) -> crate::io::Result<T> { - if t.is_minus_one() { - Err(crate::io::Error::last_os_error()) - } else { - Ok(t) - } + if t.is_minus_one() { Err(crate::io::Error::last_os_error()) } else { Ok(t) } } pub fn cvt_r<T, F>(mut f: F) -> crate::io::Result<T> - where T: IsMinusOne, - F: FnMut() -> T +where + T: IsMinusOne, + F: FnMut() -> T, { loop { match cvt(f()) { |
