diff options
| author | Celina G. Val <celinval@amazon.com> | 2025-06-11 11:12:32 -0700 |
|---|---|---|
| committer | Celina G. Val <celinval@amazon.com> | 2025-06-11 11:12:32 -0700 |
| commit | 0b9b1df0064396708a5e5ca27fd010ae3ad3a305 (patch) | |
| tree | c854a9e2fd775dba7f0a5e70a2c7be121b5fec0b /compiler/rustc_thread_pool/src/thread_pool | |
| parent | 35c5144394c1b93784867d330f694fa7c8f480e3 (diff) | |
| download | rust-0b9b1df0064396708a5e5ca27fd010ae3ad3a305.tar.gz rust-0b9b1df0064396708a5e5ca27fd010ae3ad3a305.zip | |
Fix format and tidy for code moved from rayon
Diffstat (limited to 'compiler/rustc_thread_pool/src/thread_pool')
| -rw-r--r-- | compiler/rustc_thread_pool/src/thread_pool/mod.rs | 15 | ||||
| -rw-r--r-- | compiler/rustc_thread_pool/src/thread_pool/tests.rs (renamed from compiler/rustc_thread_pool/src/thread_pool/test.rs) | 12 |
2 files changed, 12 insertions, 15 deletions
diff --git a/compiler/rustc_thread_pool/src/thread_pool/mod.rs b/compiler/rustc_thread_pool/src/thread_pool/mod.rs index 65af6d7106e..ce8783cf0d6 100644 --- a/compiler/rustc_thread_pool/src/thread_pool/mod.rs +++ b/compiler/rustc_thread_pool/src/thread_pool/mod.rs @@ -3,18 +3,17 @@ //! //! [`ThreadPool`]: struct.ThreadPool.html -use crate::broadcast::{self, BroadcastContext}; -use crate::join; -use crate::registry::{Registry, ThreadSpawn, WorkerThread}; -use crate::scope::{do_in_place_scope, do_in_place_scope_fifo}; -use crate::spawn; -use crate::{scope, Scope}; -use crate::{scope_fifo, ScopeFifo}; -use crate::{ThreadPoolBuildError, ThreadPoolBuilder}; use std::error::Error; use std::fmt; use std::sync::Arc; +use crate::broadcast::{self, BroadcastContext}; +use crate::registry::{Registry, ThreadSpawn, WorkerThread}; +use crate::scope::{do_in_place_scope, do_in_place_scope_fifo}; +use crate::{ + Scope, ScopeFifo, ThreadPoolBuildError, ThreadPoolBuilder, join, scope, scope_fifo, spawn, +}; + mod test; /// Represents a user created [thread-pool]. diff --git a/compiler/rustc_thread_pool/src/thread_pool/test.rs b/compiler/rustc_thread_pool/src/thread_pool/tests.rs index 88b36282d48..42c99565088 100644 --- a/compiler/rustc_thread_pool/src/thread_pool/test.rs +++ b/compiler/rustc_thread_pool/src/thread_pool/tests.rs @@ -4,7 +4,7 @@ use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::mpsc::channel; use std::sync::{Arc, Mutex}; -use crate::{join, Scope, ScopeFifo, ThreadPool, ThreadPoolBuilder}; +use crate::{Scope, ScopeFifo, ThreadPool, ThreadPoolBuilder, join}; #[test] #[should_panic(expected = "Hello, world!")] @@ -296,9 +296,8 @@ fn nested_scopes() { } } - let pools: Vec<_> = (0..10) - .map(|_| ThreadPoolBuilder::new().num_threads(1).build().unwrap()) - .collect(); + let pools: Vec<_> = + (0..10).map(|_| ThreadPoolBuilder::new().num_threads(1).build().unwrap()).collect(); let counter = AtomicUsize::new(0); nest(&pools, vec![], |scopes| { @@ -333,9 +332,8 @@ fn nested_fifo_scopes() { } } - let pools: Vec<_> = (0..10) - .map(|_| ThreadPoolBuilder::new().num_threads(1).build().unwrap()) - .collect(); + let pools: Vec<_> = + (0..10).map(|_| ThreadPoolBuilder::new().num_threads(1).build().unwrap()).collect(); let counter = AtomicUsize::new(0); nest(&pools, vec![], |scopes| { |
