about summary refs log tree commit diff
path: root/library/std/src/sys/pal/unix/os.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/std/src/sys/pal/unix/os.rs')
-rw-r--r--library/std/src/sys/pal/unix/os.rs27
1 files changed, 8 insertions, 19 deletions
diff --git a/library/std/src/sys/pal/unix/os.rs b/library/std/src/sys/pal/unix/os.rs
index 9adc2b94e59..a785b97ac8d 100644
--- a/library/std/src/sys/pal/unix/os.rs
+++ b/library/std/src/sys/pal/unix/os.rs
@@ -5,29 +5,20 @@
 #[cfg(test)]
 mod tests;
 
-use crate::os::unix::prelude::*;
+use core::slice::memchr;
+
+use libc::{c_char, c_int, c_void};
 
 use crate::error::Error as StdError;
 use crate::ffi::{CStr, CString, OsStr, OsString};
-use crate::fmt;
-use crate::io;
-use crate::iter;
-use crate::mem;
+use crate::os::unix::prelude::*;
 use crate::path::{self, PathBuf};
-use crate::ptr;
-use crate::slice;
-use crate::str;
 use crate::sync::{PoisonError, RwLock};
 use crate::sys::common::small_c_string::{run_path_with_cstr, run_with_cstr};
-use crate::sys::cvt;
-use crate::sys::fd;
-use crate::vec;
-use core::slice::memchr;
-
 #[cfg(all(target_env = "gnu", not(target_os = "vxworks")))]
 use crate::sys::weak::weak;
-
-use libc::{c_char, c_int, c_void};
+use crate::sys::{cvt, fd};
+use crate::{fmt, io, iter, mem, ptr, slice, str, vec};
 
 const TMPBUF_SZ: usize = 128;
 
@@ -248,13 +239,12 @@ impl StdError for JoinPathsError {
 
 #[cfg(target_os = "aix")]
 pub fn current_exe() -> io::Result<PathBuf> {
-    use crate::io::ErrorKind;
-
     #[cfg(test)]
     use realstd::env;
 
     #[cfg(not(test))]
     use crate::env;
+    use crate::io::ErrorKind;
 
     let exe_path = env::args().next().ok_or(io::const_io_error!(
         ErrorKind::NotFound,
@@ -513,13 +503,12 @@ pub fn current_exe() -> io::Result<PathBuf> {
 
 #[cfg(target_os = "fuchsia")]
 pub fn current_exe() -> io::Result<PathBuf> {
-    use crate::io::ErrorKind;
-
     #[cfg(test)]
     use realstd::env;
 
     #[cfg(not(test))]
     use crate::env;
+    use crate::io::ErrorKind;
 
     let exe_path = env::args().next().ok_or(io::const_io_error!(
         ErrorKind::Uncategorized,