diff options
| author | Zachary S <zasample18+github@gmail.com> | 2024-05-10 14:26:38 -0500 |
|---|---|---|
| committer | Zachary S <zasample18+github@gmail.com> | 2024-05-10 14:34:19 -0500 |
| commit | 8d8eb505b060c32df3ca4d4d431962870f73e7fe (patch) | |
| tree | 3cb8c01b6a0f92ba054857fd27b849c918c14596 /library/alloc/src/sync.rs | |
| parent | d6122f1924c20797a96ab83b520cbaf585a9d4b1 (diff) | |
| download | rust-8d8eb505b060c32df3ca4d4d431962870f73e7fe.tar.gz rust-8d8eb505b060c32df3ca4d4d431962870f73e7fe.zip | |
Relax A: Clone requirement on Rc/Arc::unwrap_or_clone.
Diffstat (limited to 'library/alloc/src/sync.rs')
| -rw-r--r-- | library/alloc/src/sync.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 2b8efdc400b..a35c99849b3 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -2227,7 +2227,9 @@ impl<T: Clone, A: Allocator + Clone> Arc<T, A> { // either unique to begin with, or became one upon cloning the contents. unsafe { Self::get_mut_unchecked(this) } } +} +impl<T: Clone, A: Allocator> Arc<T, A> { /// If we have the only reference to `T` then unwrap it. Otherwise, clone `T` and return the /// clone. /// |
