about summary refs log tree commit diff
diff options
context:
space:
mode:
author王宇逸 <Strawberry_Str@hotmail.com>2025-02-26 00:05:55 +0800
committer王宇逸 <Strawberry_Str@hotmail.com>2025-03-10 21:23:31 +0800
commitd24c6a29f5dca8c52ecf1ff88e4786e537078fb6 (patch)
treeadc17499130cbfd79713b491ee9fa78c77dba1ef
parentabcbd881754651af73f7454cbcbdab953d2e4e30 (diff)
downloadrust-d24c6a29f5dca8c52ecf1ff88e4786e537078fb6.tar.gz
rust-d24c6a29f5dca8c52ecf1ff88e4786e537078fb6.zip
Fix code style
-rw-r--r--library/std/src/sys/fs/unix.rs7
-rw-r--r--library/std/src/sys/pal/unix/stack_overflow.rs3
-rw-r--r--library/std/src/sys/random/linux.rs8
3 files changed, 14 insertions, 4 deletions
diff --git a/library/std/src/sys/fs/unix.rs b/library/std/src/sys/fs/unix.rs
index e99d6a07731..7774461a493 100644
--- a/library/std/src/sys/fs/unix.rs
+++ b/library/std/src/sys/fs/unix.rs
@@ -543,7 +543,12 @@ impl FileAttr {
         SystemTime::new(self.stat.st_atim.tv_sec as i64, self.stat.st_atim.tv_nsec as i64)
     }
 
-    #[cfg(any(target_os = "freebsd", target_os = "openbsd", target_vendor = "apple", target_os = "cygwin"))]
+    #[cfg(any(
+        target_os = "freebsd",
+        target_os = "openbsd",
+        target_vendor = "apple",
+        target_os = "cygwin",
+    ))]
     pub fn created(&self) -> io::Result<SystemTime> {
         SystemTime::new(self.stat.st_birthtime as i64, self.stat.st_birthtime_nsec as i64)
     }
diff --git a/library/std/src/sys/pal/unix/stack_overflow.rs b/library/std/src/sys/pal/unix/stack_overflow.rs
index 463f18800a6..344f9c63257 100644
--- a/library/std/src/sys/pal/unix/stack_overflow.rs
+++ b/library/std/src/sys/pal/unix/stack_overflow.rs
@@ -372,7 +372,8 @@ mod imp {
             // this way someone on any unix-y OS can check that all these compile
             if cfg!(all(target_os = "linux", not(target_env = "musl"))) {
                 install_main_guard_linux(page_size)
-            } else if cfg!(any(all(target_os = "linux", target_env = "musl"), target_os = "cygwin")) {
+            } else if cfg!(any(all(target_os = "linux", target_env = "musl"), target_os = "cygwin"))
+            {
                 install_main_guard_linux_musl(page_size)
             } else if cfg!(target_os = "freebsd") {
                 install_main_guard_freebsd(page_size)
diff --git a/library/std/src/sys/random/linux.rs b/library/std/src/sys/random/linux.rs
index 266c71abf3d..fb4274281d6 100644
--- a/library/std/src/sys/random/linux.rs
+++ b/library/std/src/sys/random/linux.rs
@@ -95,9 +95,13 @@ fn getrandom(mut bytes: &mut [u8], insecure: bool) {
             let flags = if insecure {
                 if GRND_INSECURE_AVAILABLE.load(Relaxed) {
                     #[cfg(target_os = "cygwin")]
-                    { libc::GRND_NONBLOCK }
+                    {
+                        libc::GRND_NONBLOCK
+                    }
                     #[cfg(not(target_os = "cygwin"))]
-                    { libc::GRND_INSECURE }
+                    {
+                        libc::GRND_INSECURE
+                    }
                 } else {
                     libc::GRND_NONBLOCK
                 }