diff options
| author | Matthew Giordano <mgiordan@cs.washington.edu> | 2024-08-29 12:32:33 -0700 |
|---|---|---|
| committer | Matthew Giordano <mgiordan@cs.washington.edu> | 2024-08-29 12:32:33 -0700 |
| commit | 21cb84763cf942dc2fa70d582cf2b8ba50163750 (patch) | |
| tree | 8c5cef39d23961839e110cd2555e82c9766c0eb6 /library/alloc/src/rc.rs | |
| parent | 13e36cf8870a88ab0ac5651d9513b13085baa8cc (diff) | |
| download | rust-21cb84763cf942dc2fa70d582cf2b8ba50163750.tar.gz rust-21cb84763cf942dc2fa70d582cf2b8ba50163750.zip | |
fix fmt
Diffstat (limited to 'library/alloc/src/rc.rs')
| -rw-r--r-- | library/alloc/src/rc.rs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index 151eec53261..0afb138db8a 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -1710,11 +1710,7 @@ impl<T: ?Sized, A: Allocator> Rc<T, A> { #[inline] #[stable(feature = "rc_unique", since = "1.4.0")] pub fn get_mut(this: &mut Self) -> Option<&mut T> { - if Rc::is_unique(this) { - unsafe { Some(Rc::get_mut_unchecked(this)) } - } else { - None - } + if Rc::is_unique(this) { unsafe { Some(Rc::get_mut_unchecked(this)) } } else { None } } /// Returns a mutable reference into the given `Rc`, @@ -3291,11 +3287,7 @@ impl<T: ?Sized, A: Allocator> Weak<T, A> { #[must_use] #[stable(feature = "weak_counts", since = "1.41.0")] pub fn strong_count(&self) -> usize { - if let Some(inner) = self.inner() { - inner.strong() - } else { - 0 - } + if let Some(inner) = self.inner() { inner.strong() } else { 0 } } /// Gets the number of `Weak` pointers pointing to this allocation. |
