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/hermit/mod.rs | |
| parent | 9081929d45f12d3f56d43b1d6db7519981580fc9 (diff) | |
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/hermit/mod.rs')
| -rw-r--r-- | src/libstd/sys/hermit/mod.rs | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/src/libstd/sys/hermit/mod.rs b/src/libstd/sys/hermit/mod.rs index d4359631769..1e4a53abdc7 100644 --- a/src/libstd/sys/hermit/mod.rs +++ b/src/libstd/sys/hermit/mod.rs @@ -13,34 +13,34 @@ //! compiling for wasm. That way it's a compile time error for something that's //! guaranteed to be a runtime error! -use crate::os::raw::c_char; use crate::intrinsics; +use crate::os::raw::c_char; pub mod alloc; pub mod args; -pub mod condvar; -pub mod stdio; -pub mod memchr; -pub mod io; -pub mod mutex; -pub mod rwlock; -pub mod os; pub mod cmath; -pub mod thread; +pub mod condvar; pub mod env; -pub mod fs; +pub mod fast_thread_local; pub mod fd; +pub mod fs; +pub mod io; +pub mod memchr; +pub mod mutex; pub mod net; +pub mod os; pub mod path; pub mod pipe; pub mod process; +pub mod rwlock; pub mod stack_overflow; -pub mod time; +pub mod stdio; +pub mod thread; pub mod thread_local; -pub mod fast_thread_local; +pub mod time; -pub use crate::sys_common::os_str_bytes as os_str; use crate::io::ErrorKind; +pub use crate::sys_common::os_str_bytes as os_str; #[allow(unused_extern_crates)] pub extern crate hermit_abi as abi; @@ -50,8 +50,7 @@ pub fn unsupported<T>() -> crate::io::Result<T> { } pub fn unsupported_err() -> crate::io::Error { - crate::io::Error::new(crate::io::ErrorKind::Other, - "operation not supported on HermitCore yet") + crate::io::Error::new(crate::io::ErrorKind::Other, "operation not supported on HermitCore yet") } // This enum is used as the storage for a bunch of types which can't actually @@ -71,9 +70,7 @@ pub unsafe fn strlen(start: *const c_char) -> usize { #[no_mangle] pub extern "C" fn floor(x: f64) -> f64 { - unsafe { - intrinsics::floorf64(x) - } + unsafe { intrinsics::floorf64(x) } } pub unsafe fn abort_internal() -> ! { @@ -103,8 +100,11 @@ pub fn init() { #[cfg(not(test))] #[no_mangle] -pub unsafe extern "C" fn runtime_entry(argc: i32, argv: *const *const c_char, - env: *const *const c_char) -> ! { +pub unsafe extern "C" fn runtime_entry( + argc: i32, + argv: *const *const c_char, + env: *const *const c_char, +) -> ! { extern "C" { fn main(argc: isize, argv: *const *const c_char) -> i32; } @@ -139,9 +139,5 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind { } pub fn cvt(result: i32) -> crate::io::Result<usize> { - if result < 0 { - Err(crate::io::Error::from_raw_os_error(-result)) - } else { - Ok(result as usize) - } + if result < 0 { Err(crate::io::Error::from_raw_os_error(-result)) } else { Ok(result as usize) } } |
