diff options
| author | Josh Triplett <josh@joshtriplett.org> | 2024-12-17 14:33:10 -0800 |
|---|---|---|
| committer | Josh Triplett <josh@joshtriplett.org> | 2024-12-17 14:33:10 -0800 |
| commit | a105cd606628b07e79ab343cc183a176e278c809 (patch) | |
| tree | 051f572eb6a1fcf3cb4541d4c427e0c13d02a8bd /library/alloc/src/sync.rs | |
| parent | a4cb3c831823d9baa56c3d90514b75b2660116fa (diff) | |
| download | rust-a105cd606628b07e79ab343cc183a176e278c809.tar.gz rust-a105cd606628b07e79ab343cc183a176e278c809.zip | |
Use field init shorthand where possible
Field init shorthand allows writing initializers like `tcx: tcx` as `tcx`. The compiler already uses it extensively. Fix the last few places where it isn't yet used.
Diffstat (limited to 'library/alloc/src/sync.rs')
| -rw-r--r-- | library/alloc/src/sync.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 6cf41a3fa4e..9be0b3e3e88 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -784,7 +784,7 @@ impl<T, A: Allocator> Arc<T, A> { let uninit_ptr: NonNull<_> = (unsafe { &mut *uninit_raw_ptr }).into(); let init_ptr: NonNull<ArcInner<T>> = uninit_ptr.cast(); - let weak = Weak { ptr: init_ptr, alloc: alloc }; + let weak = Weak { ptr: init_ptr, alloc }; // It's important we don't give up ownership of the weak pointer, or // else the memory might be freed by the time `data_fn` returns. If |
