about summary refs log tree commit diff
path: root/library/std/src/thread
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2024-06-19 01:51:42 +0100
committerGitHub <noreply@github.com>2024-06-19 01:51:42 +0100
commit7450ab7acbadcf8d912a02a0f05bb7ea46d55740 (patch)
tree138e66f51265de06a6050dd59015e368af8a2815 /library/std/src/thread
parenta2436a83d3994c53c1f5129526ebbfbb2d737963 (diff)
parent7321e791141ddf2ec4d5f8a9893146832118bb19 (diff)
downloadrust-7450ab7acbadcf8d912a02a0f05bb7ea46d55740.tar.gz
rust-7450ab7acbadcf8d912a02a0f05bb7ea46d55740.zip
Rollup merge of #126632 - Vonr:fix/moving-closure-formatting-v2, r=Nilstrieb
Replace `move||` with `move ||`

Edit from #126631 to revert changes in `tests/ui`.

There are 18 instances of `move||` across 6 files in the repo:
- `compiler/rustc_hir_typeck/src/typeck_root_ctxt.rs`
- `library/core/src/sync/atomic.rs`
- `library/std/src/sync/condvar.rs`
- `library/std/src/sync/mpsc/mod.rs`
- `library/std/src/sync/barrier.rs`
- `library/std/src/thread/local.rs`

I have replaced all such instances with `move ||` instead as it better adheres to modern formatting standards.

Ideally, we would have this automated by rustfmt or some other tool, but I do not have the time to implement such a feature or tool.
Nonetheless, I would encourage any effort invested into such a tool or feature.
Diffstat (limited to 'library/std/src/thread')
-rw-r--r--library/std/src/thread/local.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/thread/local.rs b/library/std/src/thread/local.rs
index aed185637fd..f147c5fdcd1 100644
--- a/library/std/src/thread/local.rs
+++ b/library/std/src/thread/local.rs
@@ -62,7 +62,7 @@ use crate::fmt;
 /// FOO.set(2);
 ///
 /// // each thread starts out with the initial value of 1
-/// let t = thread::spawn(move|| {
+/// let t = thread::spawn(move || {
 ///     assert_eq!(FOO.get(), 1);
 ///     FOO.set(3);
 /// });