about summary refs log tree commit diff
path: root/library/std/src/os
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-09-22 19:05:04 -0400
committerMichael Goulet <michael@errs.io>2024-09-22 19:11:29 -0400
commitc682aa162b0d41e21cc6748f4fecfe01efb69d1f (patch)
tree0c31b640e3faacfb187a1509e3da5d5b6ba0109c /library/std/src/os
parent1173204b364841b51598744fc69d7c80be10f956 (diff)
Reformat using the new identifier sorting from rustfmt
Diffstat (limited to 'library/std/src/os')
-rw-r--r--library/std/src/os/fortanix_sgx/mod.rs12
-rw-r--r--library/std/src/os/unix/net/ancillary.rs2
-rw-r--r--library/std/src/os/unix/net/datagram.rs4
-rw-r--r--library/std/src/os/unix/net/listener.rs2
-rw-r--r--library/std/src/os/unix/net/stream.rs8
-rw-r--r--library/std/src/os/unix/net/ucred.rs4
-rw-r--r--library/std/src/os/xous/ffi/definitions.rs66
-rw-r--r--library/std/src/os/xous/services.rs2
-rw-r--r--library/std/src/os/xous/services/systime.rs2
9 files changed, 48 insertions, 54 deletions
diff --git a/library/std/src/os/fortanix_sgx/mod.rs b/library/std/src/os/fortanix_sgx/mod.rs
index 64f4d97ca95..2b5ccbe98f1 100644
--- a/library/std/src/os/fortanix_sgx/mod.rs
+++ b/library/std/src/os/fortanix_sgx/mod.rs
@@ -22,12 +22,12 @@ pub mod usercalls {
     /// Lowest-level interfaces to usercalls and usercall ABI type definitions.
     pub mod raw {
         pub use crate::sys::abi::usercalls::raw::{
-            accept_stream, alloc, async_queues, bind_stream, close, connect_stream, do_usercall,
-            exit, flush, free, insecure_time, launch_thread, read, read_alloc, send, wait, write,
-            ByteBuffer, Cancel, Error, Fd, FifoDescriptor, Register, RegisterArgument, Result,
-            Return, ReturnValue, Tcs, Usercall, Usercalls as UsercallNrs, EV_RETURNQ_NOT_EMPTY,
-            EV_UNPARK, EV_USERCALLQ_NOT_FULL, FD_STDERR, FD_STDIN, FD_STDOUT, RESULT_SUCCESS,
-            USERCALL_USER_DEFINED, WAIT_INDEFINITE, WAIT_NO,
+            ByteBuffer, Cancel, EV_RETURNQ_NOT_EMPTY, EV_UNPARK, EV_USERCALLQ_NOT_FULL, Error,
+            FD_STDERR, FD_STDIN, FD_STDOUT, Fd, FifoDescriptor, RESULT_SUCCESS, Register,
+            RegisterArgument, Result, Return, ReturnValue, Tcs, USERCALL_USER_DEFINED, Usercall,
+            Usercalls as UsercallNrs, WAIT_INDEFINITE, WAIT_NO, accept_stream, alloc, async_queues,
+            bind_stream, close, connect_stream, do_usercall, exit, flush, free, insecure_time,
+            launch_thread, read, read_alloc, send, wait, write,
         };
     }
 }
diff --git a/library/std/src/os/unix/net/ancillary.rs b/library/std/src/os/unix/net/ancillary.rs
index 9b487a62982..c34a3b4e184 100644
--- a/library/std/src/os/unix/net/ancillary.rs
+++ b/library/std/src/os/unix/net/ancillary.rs
@@ -1,6 +1,6 @@
 // FIXME: This is currently disabled on *BSD.
 
-use super::{sockaddr_un, SocketAddr};
+use super::{SocketAddr, sockaddr_un};
 use crate::io::{self, IoSlice, IoSliceMut};
 use crate::marker::PhantomData;
 use crate::mem::zeroed;
diff --git a/library/std/src/os/unix/net/datagram.rs b/library/std/src/os/unix/net/datagram.rs
index a605c3d4a26..48aaddd2d52 100644
--- a/library/std/src/os/unix/net/datagram.rs
+++ b/library/std/src/os/unix/net/datagram.rs
@@ -12,9 +12,9 @@
 ))]
 use libc::MSG_NOSIGNAL;
 
+use super::{SocketAddr, sockaddr_un};
 #[cfg(any(doc, target_os = "android", target_os = "linux"))]
-use super::{recv_vectored_with_ancillary_from, send_vectored_with_ancillary_to, SocketAncillary};
-use super::{sockaddr_un, SocketAddr};
+use super::{SocketAncillary, recv_vectored_with_ancillary_from, send_vectored_with_ancillary_to};
 #[cfg(any(doc, target_os = "android", target_os = "linux"))]
 use crate::io::{IoSlice, IoSliceMut};
 use crate::net::Shutdown;
diff --git a/library/std/src/os/unix/net/listener.rs b/library/std/src/os/unix/net/listener.rs
index a55199c82fc..440408eb13f 100644
--- a/library/std/src/os/unix/net/listener.rs
+++ b/library/std/src/os/unix/net/listener.rs
@@ -1,4 +1,4 @@
-use super::{sockaddr_un, SocketAddr, UnixStream};
+use super::{SocketAddr, UnixStream, sockaddr_un};
 use crate::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, OwnedFd, RawFd};
 use crate::path::Path;
 use crate::sys::cvt;
diff --git a/library/std/src/os/unix/net/stream.rs b/library/std/src/os/unix/net/stream.rs
index 19fc7b3d853..4967c5b89ec 100644
--- a/library/std/src/os/unix/net/stream.rs
+++ b/library/std/src/os/unix/net/stream.rs
@@ -1,3 +1,6 @@
+use super::{SocketAddr, sockaddr_un};
+#[cfg(any(doc, target_os = "android", target_os = "linux"))]
+use super::{SocketAncillary, recv_vectored_with_ancillary_from, send_vectored_with_ancillary_to};
 #[cfg(any(
     target_os = "android",
     target_os = "linux",
@@ -8,10 +11,7 @@
     target_os = "nto",
     target_vendor = "apple",
 ))]
-use super::{peer_cred, UCred};
-#[cfg(any(doc, target_os = "android", target_os = "linux"))]
-use super::{recv_vectored_with_ancillary_from, send_vectored_with_ancillary_to, SocketAncillary};
-use super::{sockaddr_un, SocketAddr};
+use super::{UCred, peer_cred};
 use crate::fmt;
 use crate::io::{self, IoSlice, IoSliceMut};
 use crate::net::Shutdown;
diff --git a/library/std/src/os/unix/net/ucred.rs b/library/std/src/os/unix/net/ucred.rs
index b96e373ad0a..c818bd05858 100644
--- a/library/std/src/os/unix/net/ucred.rs
+++ b/library/std/src/os/unix/net/ucred.rs
@@ -38,7 +38,7 @@ pub(super) use self::impl_linux::peer_cred;
 
 #[cfg(any(target_os = "linux", target_os = "android"))]
 mod impl_linux {
-    use libc::{c_void, getsockopt, socklen_t, ucred, SOL_SOCKET, SO_PEERCRED};
+    use libc::{SO_PEERCRED, SOL_SOCKET, c_void, getsockopt, socklen_t, ucred};
 
     use super::UCred;
     use crate::os::unix::io::AsRawFd;
@@ -98,7 +98,7 @@ mod impl_bsd {
 
 #[cfg(target_vendor = "apple")]
 mod impl_apple {
-    use libc::{c_void, getpeereid, getsockopt, pid_t, socklen_t, LOCAL_PEERPID, SOL_LOCAL};
+    use libc::{LOCAL_PEERPID, SOL_LOCAL, c_void, getpeereid, getsockopt, pid_t, socklen_t};
 
     use super::UCred;
     use crate::os::unix::io::AsRawFd;
diff --git a/library/std/src/os/xous/ffi/definitions.rs b/library/std/src/os/xous/ffi/definitions.rs
index 345005bcc78..1b16849af03 100644
--- a/library/std/src/os/xous/ffi/definitions.rs
+++ b/library/std/src/os/xous/ffi/definitions.rs
@@ -126,42 +126,36 @@ impl From<i32> for Error {
 #[stable(feature = "rust1", since = "1.0.0")]
 impl core::fmt::Display for Error {
     fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
-        write!(
-            f,
-            "{}",
-            match self {
-                Error::NoError => "no error occurred",
-                Error::BadAlignment => "memory was not properly aligned",
-                Error::BadAddress => "an invalid address was supplied",
-                Error::OutOfMemory => "the process or service has run out of memory",
-                Error::MemoryInUse => "the requested address is in use",
-                Error::InterruptNotFound =>
-                    "the requested interrupt does not exist on this platform",
-                Error::InterruptInUse => "the requested interrupt is currently in use",
-                Error::InvalidString => "the specified string was not formatted correctly",
-                Error::ServerExists => "a server with that address already exists",
-                Error::ServerNotFound => "the requetsed server could not be found",
-                Error::ProcessNotFound => "the target process does not exist",
-                Error::ProcessNotChild =>
-                    "the requested operation can only be done on child processes",
-                Error::ProcessTerminated => "the target process has crashed",
-                Error::Timeout => "the requested operation timed out",
-                Error::InternalError => "an internal error occurred",
-                Error::ServerQueueFull => "the server has too many pending messages",
-                Error::ThreadNotAvailable => "the specified thread does not exist",
-                Error::UnhandledSyscall => "the kernel did not recognize that syscall",
-                Error::InvalidSyscall => "the syscall had incorrect parameters",
-                Error::ShareViolation => "an attempt was made to share memory twice",
-                Error::InvalidThread => "tried to resume a thread that was not ready",
-                Error::InvalidPid => "kernel attempted to use a pid that was not valid",
-                Error::AccessDenied => "no permission to perform the requested operation",
-                Error::UseBeforeInit => "attempt to use a service before initialization finished",
-                Error::DoubleFree => "the requested resource was freed twice",
-                Error::DebugInProgress => "kernel attempted to activate a thread being debugged",
-                Error::InvalidLimit => "process attempted to adjust an invalid limit",
-                Error::UnknownError => "an unknown error occurred",
-            }
-        )
+        write!(f, "{}", match self {
+            Error::NoError => "no error occurred",
+            Error::BadAlignment => "memory was not properly aligned",
+            Error::BadAddress => "an invalid address was supplied",
+            Error::OutOfMemory => "the process or service has run out of memory",
+            Error::MemoryInUse => "the requested address is in use",
+            Error::InterruptNotFound => "the requested interrupt does not exist on this platform",
+            Error::InterruptInUse => "the requested interrupt is currently in use",
+            Error::InvalidString => "the specified string was not formatted correctly",
+            Error::ServerExists => "a server with that address already exists",
+            Error::ServerNotFound => "the requetsed server could not be found",
+            Error::ProcessNotFound => "the target process does not exist",
+            Error::ProcessNotChild => "the requested operation can only be done on child processes",
+            Error::ProcessTerminated => "the target process has crashed",
+            Error::Timeout => "the requested operation timed out",
+            Error::InternalError => "an internal error occurred",
+            Error::ServerQueueFull => "the server has too many pending messages",
+            Error::ThreadNotAvailable => "the specified thread does not exist",
+            Error::UnhandledSyscall => "the kernel did not recognize that syscall",
+            Error::InvalidSyscall => "the syscall had incorrect parameters",
+            Error::ShareViolation => "an attempt was made to share memory twice",
+            Error::InvalidThread => "tried to resume a thread that was not ready",
+            Error::InvalidPid => "kernel attempted to use a pid that was not valid",
+            Error::AccessDenied => "no permission to perform the requested operation",
+            Error::UseBeforeInit => "attempt to use a service before initialization finished",
+            Error::DoubleFree => "the requested resource was freed twice",
+            Error::DebugInProgress => "kernel attempted to activate a thread being debugged",
+            Error::InvalidLimit => "process attempted to adjust an invalid limit",
+            Error::UnknownError => "an unknown error occurred",
+        })
     }
 }
 
diff --git a/library/std/src/os/xous/services.rs b/library/std/src/os/xous/services.rs
index ddf0236f5ad..93916750c05 100644
--- a/library/std/src/os/xous/services.rs
+++ b/library/std/src/os/xous/services.rs
@@ -19,7 +19,7 @@ pub(crate) use ticktimer::*;
 
 mod ns {
     const NAME_MAX_LENGTH: usize = 64;
-    use crate::os::xous::ffi::{lend_mut, Connection};
+    use crate::os::xous::ffi::{Connection, lend_mut};
     // By making this repr(C), the layout of this struct becomes well-defined
     // and no longer shifts around.
     // By marking it as `align(4096)` we define that it will be page-aligned,
diff --git a/library/std/src/os/xous/services/systime.rs b/library/std/src/os/xous/services/systime.rs
index 079ede7aa86..de87694b4cd 100644
--- a/library/std/src/os/xous/services/systime.rs
+++ b/library/std/src/os/xous/services/systime.rs
@@ -1,6 +1,6 @@
 use core::sync::atomic::{AtomicU32, Ordering};
 
-use crate::os::xous::ffi::{connect, Connection};
+use crate::os::xous::ffi::{Connection, connect};
 
 pub(crate) enum SystimeScalar {
     GetUtcTimeMs,