about summary refs log tree commit diff
path: root/library/alloc/src/rc.rs
diff options
context:
space:
mode:
authorMatthew Giordano <mgiordan@cs.washington.edu>2024-08-29 12:32:33 -0700
committerMatthew Giordano <mgiordan@cs.washington.edu>2024-08-29 12:32:33 -0700
commit21cb84763cf942dc2fa70d582cf2b8ba50163750 (patch)
tree8c5cef39d23961839e110cd2555e82c9766c0eb6 /library/alloc/src/rc.rs
parent13e36cf8870a88ab0ac5651d9513b13085baa8cc (diff)
downloadrust-21cb84763cf942dc2fa70d582cf2b8ba50163750.tar.gz
rust-21cb84763cf942dc2fa70d582cf2b8ba50163750.zip
fix fmt
Diffstat (limited to 'library/alloc/src/rc.rs')
-rw-r--r--library/alloc/src/rc.rs12
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.