diff options
| author | bors <bors@rust-lang.org> | 2024-07-29 02:43:41 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-07-29 02:43:41 +0000 |
| commit | 2e630267b2bce50af3258ce4817e377fa09c145b (patch) | |
| tree | 29006db815bf547dfd0129910b23b8c54675bd98 /library/std/src/sys/pal/unix/os.rs | |
| parent | 2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b (diff) | |
| parent | 84ac80f1921afc243d71fd0caaa4f2838c294102 (diff) | |
| download | rust-2e630267b2bce50af3258ce4817e377fa09c145b.tar.gz rust-2e630267b2bce50af3258ce4817e377fa09c145b.zip | |
Auto merge of #125443 - nnethercote:rustfmt-use-decls, r=lcnr,cuviper,GuillaumeGomez
rustfmt `use` declarations This PR implements https://github.com/rust-lang/compiler-team/issues/750, which changes how `use` declarations are formatted by adding these options to `rustfmt.toml`: ``` group_imports = "StdExternalCrate" imports_granularity = "Module" ``` r? `@ghost`
Diffstat (limited to 'library/std/src/sys/pal/unix/os.rs')
| -rw-r--r-- | library/std/src/sys/pal/unix/os.rs | 27 |
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, |
