Skip to content

Commit

Permalink
fix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Giordano committed Aug 29, 2024
1 parent ea236f0 commit 7d4ef17
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions alloc/src/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 7d4ef17

Please sign in to comment.