From 60091ee826b071a122ad4ef4ae833591e1db553b Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 27 Nov 2019 10:28:21 -0800 Subject: Format libstd/os with rustfmt This commit applies rustfmt with rust-lang/rust's default settings to files in src/libstd/os *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/os -name '*.rs' \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ rg libstd/os 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 --- src/libstd/os/android/fs.rs | 13 ++++++------- src/libstd/os/android/mod.rs | 2 +- src/libstd/os/android/raw.rs | 26 +++++++++++++------------- 3 files changed, 20 insertions(+), 21 deletions(-) (limited to 'src/libstd/os/android') diff --git a/src/libstd/os/android/fs.rs b/src/libstd/os/android/fs.rs index 90fdee567ae..9356e607c90 100644 --- a/src/libstd/os/android/fs.rs +++ b/src/libstd/os/android/fs.rs @@ -18,9 +18,11 @@ pub trait MetadataExt { /// Unix platforms. The `os::unix::fs::MetadataExt` trait contains the /// cross-Unix abstractions contained within the raw stat. #[stable(feature = "metadata_ext", since = "1.1.0")] - #[rustc_deprecated(since = "1.8.0", - reason = "deprecated in favor of the accessor \ - methods of this trait")] + #[rustc_deprecated( + since = "1.8.0", + reason = "deprecated in favor of the accessor \ + methods of this trait" + )] #[allow(deprecated)] fn as_raw_stat(&self) -> &raw::stat; @@ -62,10 +64,7 @@ pub trait MetadataExt { impl MetadataExt for Metadata { #[allow(deprecated)] fn as_raw_stat(&self) -> &raw::stat { - unsafe { - &*(self.as_inner().as_inner() as *const libc::stat - as *const raw::stat) - } + unsafe { &*(self.as_inner().as_inner() as *const libc::stat as *const raw::stat) } } fn st_dev(&self) -> u64 { self.as_inner().as_inner().st_dev as u64 diff --git a/src/libstd/os/android/mod.rs b/src/libstd/os/android/mod.rs index ad1cd85095d..dbb0127f369 100644 --- a/src/libstd/os/android/mod.rs +++ b/src/libstd/os/android/mod.rs @@ -2,5 +2,5 @@ #![stable(feature = "raw_ext", since = "1.1.0")] -pub mod raw; pub mod fs; +pub mod raw; diff --git a/src/libstd/os/android/raw.rs b/src/libstd/os/android/raw.rs index 946a77cbfd3..2b8ade8a82e 100644 --- a/src/libstd/os/android/raw.rs +++ b/src/libstd/os/android/raw.rs @@ -1,11 +1,13 @@ //! Android-specific raw type definitions #![stable(feature = "raw_ext", since = "1.1.0")] -#![rustc_deprecated(since = "1.8.0", - reason = "these type aliases are no longer supported by \ - the standard library, the `libc` crate on \ - crates.io should be used instead for the correct \ - definitions")] +#![rustc_deprecated( + since = "1.8.0", + reason = "these type aliases are no longer supported by \ + the standard library, the `libc` crate on \ + crates.io should be used instead for the correct \ + definitions" +)] #![allow(deprecated)] use crate::os::raw::c_long; @@ -15,12 +17,12 @@ pub type pthread_t = c_long; #[doc(inline)] #[stable(feature = "raw_ext", since = "1.1.0")] -pub use self::arch::{dev_t, mode_t, blkcnt_t, blksize_t, ino_t, nlink_t, off_t, stat, time_t}; +pub use self::arch::{blkcnt_t, blksize_t, dev_t, ino_t, mode_t, nlink_t, off_t, stat, time_t}; #[cfg(any(target_arch = "arm", target_arch = "x86"))] mod arch { - use crate::os::raw::{c_uint, c_uchar, c_ulonglong, c_longlong, c_ulong}; - use crate::os::unix::raw::{uid_t, gid_t}; + use crate::os::raw::{c_longlong, c_uchar, c_uint, c_ulong, c_ulonglong}; + use crate::os::unix::raw::{gid_t, uid_t}; #[stable(feature = "raw_ext", since = "1.1.0")] pub type dev_t = u64; @@ -83,14 +85,12 @@ mod arch { #[stable(feature = "raw_ext", since = "1.1.0")] pub st_ino: c_ulonglong, } - } - #[cfg(target_arch = "aarch64")] mod arch { use crate::os::raw::{c_uchar, c_ulong}; - use crate::os::unix::raw::{uid_t, gid_t}; + use crate::os::unix::raw::{gid_t, uid_t}; #[stable(feature = "raw_ext", since = "1.1.0")] pub type dev_t = u64; @@ -157,8 +157,8 @@ mod arch { #[cfg(target_arch = "x86_64")] mod arch { - use crate::os::raw::{c_uint, c_long, c_ulong}; - use crate::os::unix::raw::{uid_t, gid_t}; + use crate::os::raw::{c_long, c_uint, c_ulong}; + use crate::os::unix::raw::{gid_t, uid_t}; #[stable(feature = "raw_ext", since = "1.1.0")] pub type dev_t = u64; -- cgit 1.4.1-3-g733a5