diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-12-22 17:42:04 -0500 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-12-22 17:42:47 -0500 |
| commit | a06baa56b95674fc626b3c3fd680d6a65357fe60 (patch) | |
| tree | cd9d867c2ca3cff5c1d6b3bd73377c44649fb075 /src/libstd/sys_common/mod.rs | |
| parent | 8eb7c58dbb7b32701af113bc58722d0d1fefb1eb (diff) | |
| download | rust-a06baa56b95674fc626b3c3fd680d6a65357fe60.tar.gz rust-a06baa56b95674fc626b3c3fd680d6a65357fe60.zip | |
Format the world
Diffstat (limited to 'src/libstd/sys_common/mod.rs')
| -rw-r--r-- | src/libstd/sys_common/mod.rs | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/src/libstd/sys_common/mod.rs b/src/libstd/sys_common/mod.rs index 8912aed9255..ca8c63d62a6 100644 --- a/src/libstd/sys_common/mod.rs +++ b/src/libstd/sys_common/mod.rs @@ -23,26 +23,32 @@ macro_rules! rtabort { } macro_rules! rtassert { - ($e:expr) => (if !$e { - rtabort!(concat!("assertion failed: ", stringify!($e))); - }) + ($e:expr) => { + if !$e { + rtabort!(concat!("assertion failed: ", stringify!($e))); + } + }; } #[allow(unused_macros)] // not used on all platforms macro_rules! rtunwrap { - ($ok:ident, $e:expr) => (match $e { - $ok(v) => v, - ref err => { - let err = err.as_ref().map(|_|()); // map Ok/Some which might not be Debug - rtabort!(concat!("unwrap failed: ", stringify!($e), " = {:?}"), err) - }, - }) + ($ok:ident, $e:expr) => { + match $e { + $ok(v) => v, + ref err => { + let err = err.as_ref().map(|_| ()); // map Ok/Some which might not be Debug + rtabort!(concat!("unwrap failed: ", stringify!($e), " = {:?}"), err) + } + } + }; } pub mod alloc; pub mod at_exit_imp; pub mod backtrace; +pub mod bytestring; pub mod condvar; +pub mod fs; pub mod io; pub mod mutex; #[cfg(any(doc, // see `mod os`, docs are generated for multiple platforms @@ -54,6 +60,7 @@ pub mod mutex; all(target_vendor = "fortanix", target_env = "sgx")))] pub mod os_str_bytes; pub mod poison; +pub mod process; pub mod remutex; pub mod rwlock; pub mod thread; @@ -61,9 +68,6 @@ pub mod thread_info; pub mod thread_local; pub mod util; pub mod wtf8; -pub mod bytestring; -pub mod process; -pub mod fs; cfg_if::cfg_if! { if #[cfg(any(target_os = "cloudabi", @@ -114,7 +118,7 @@ pub trait FromInner<Inner> { /// that the closure could not be registered, meaning that it is not scheduled /// to be run. pub fn at_exit<F: FnOnce() + Send + 'static>(f: F) -> Result<(), ()> { - if at_exit_imp::push(Box::new(f)) {Ok(())} else {Err(())} + if at_exit_imp::push(Box::new(f)) { Ok(()) } else { Err(()) } } /// One-time runtime cleanup. @@ -142,6 +146,5 @@ pub fn mul_div_u64(value: u64, numer: u64, denom: u64) -> u64 { #[test] fn test_muldiv() { - assert_eq!(mul_div_u64( 1_000_000_000_001, 1_000_000_000, 1_000_000), - 1_000_000_000_001_000); + assert_eq!(mul_div_u64(1_000_000_000_001, 1_000_000_000, 1_000_000), 1_000_000_000_001_000); } |
