about summary refs log tree commit diff
path: root/library/std/src/thread
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-07-29 08:13:50 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-07-29 08:26:52 +1000
commit84ac80f1921afc243d71fd0caaa4f2838c294102 (patch)
tree29006db815bf547dfd0129910b23b8c54675bd98 /library/std/src/thread
parent118f9350c5b902e462a6dcc4325670f3da701600 (diff)
downloadrust-84ac80f1921afc243d71fd0caaa4f2838c294102.tar.gz
rust-84ac80f1921afc243d71fd0caaa4f2838c294102.zip
Reformat `use` declarations.
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
Diffstat (limited to 'library/std/src/thread')
-rw-r--r--library/std/src/thread/mod.rs10
-rw-r--r--library/std/src/thread/scoped.rs3
-rw-r--r--library/std/src/thread/tests.rs14
3 files changed, 9 insertions, 18 deletions
diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs
index ce6a6afdc19..59720f77465 100644
--- a/library/std/src/thread/mod.rs
+++ b/library/std/src/thread/mod.rs
@@ -160,24 +160,19 @@ mod tests;
 
 use crate::any::Any;
 use crate::cell::{Cell, OnceCell, UnsafeCell};
-use crate::env;
 use crate::ffi::CStr;
-use crate::fmt;
-use crate::io;
 use crate::marker::PhantomData;
 use crate::mem::{self, forget, ManuallyDrop};
 use crate::num::NonZero;
-use crate::panic;
-use crate::panicking;
 use crate::pin::Pin;
 use crate::ptr::addr_of_mut;
-use crate::str;
 use crate::sync::atomic::{AtomicUsize, Ordering};
 use crate::sync::Arc;
 use crate::sys::sync::Parker;
 use crate::sys::thread as imp;
 use crate::sys_common::{AsInner, IntoInner};
 use crate::time::{Duration, Instant};
+use crate::{env, fmt, io, panic, panicking, str};
 
 #[stable(feature = "scoped_threads", since = "1.63.0")]
 mod scoped;
@@ -1292,9 +1287,10 @@ enum ThreadName {
 
 // This module ensures private fields are kept private, which is necessary to enforce the safety requirements.
 mod thread_name_string {
+    use core::str;
+
     use super::ThreadName;
     use crate::ffi::{CStr, CString};
-    use core::str;
 
     /// Like a `String` it's guaranteed UTF-8 and like a `CString` it's null terminated.
     pub(crate) struct ThreadNameString {
diff --git a/library/std/src/thread/scoped.rs b/library/std/src/thread/scoped.rs
index fbd6f8feecf..ba27c9220ae 100644
--- a/library/std/src/thread/scoped.rs
+++ b/library/std/src/thread/scoped.rs
@@ -1,10 +1,9 @@
 use super::{current, park, Builder, JoinInner, Result, Thread};
-use crate::fmt;
-use crate::io;
 use crate::marker::PhantomData;
 use crate::panic::{catch_unwind, resume_unwind, AssertUnwindSafe};
 use crate::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
 use crate::sync::Arc;
+use crate::{fmt, io};
 
 /// A scope to spawn scoped threads in.
 ///
diff --git a/library/std/src/thread/tests.rs b/library/std/src/thread/tests.rs
index 1fb1333be0e..aa464d56f95 100644
--- a/library/std/src/thread/tests.rs
+++ b/library/std/src/thread/tests.rs
@@ -1,16 +1,12 @@
 use super::Builder;
 use crate::any::Any;
-use crate::mem;
 use crate::panic::panic_any;
-use crate::result;
-use crate::sync::{
-    atomic::{AtomicBool, Ordering},
-    mpsc::{channel, Sender},
-    Arc, Barrier,
-};
+use crate::sync::atomic::{AtomicBool, Ordering};
+use crate::sync::mpsc::{channel, Sender};
+use crate::sync::{Arc, Barrier};
 use crate::thread::{self, Scope, ThreadId};
-use crate::time::Duration;
-use crate::time::Instant;
+use crate::time::{Duration, Instant};
+use crate::{mem, result};
 
 // !!! These tests are dangerous. If something is buggy, they will hang, !!!
 // !!! instead of exiting cleanly. This might wedge the buildbots.       !!!