Skip to content

Commit 7d4ef17

Browse files
author
Matthew Giordano
committed
fix fmt
1 parent ea236f0 commit 7d4ef17

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

alloc/src/rc.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -1710,11 +1710,7 @@ impl<T: ?Sized, A: Allocator> Rc<T, A> {
17101710
#[inline]
17111711
#[stable(feature = "rc_unique", since = "1.4.0")]
17121712
pub fn get_mut(this: &mut Self) -> Option<&mut T> {
1713-
if Rc::is_unique(this) {
1714-
unsafe { Some(Rc::get_mut_unchecked(this)) }
1715-
} else {
1716-
None
1717-
}
1713+
if Rc::is_unique(this) { unsafe { Some(Rc::get_mut_unchecked(this)) } } else { None }
17181714
}
17191715

17201716
/// Returns a mutable reference into the given `Rc`,
@@ -3291,11 +3287,7 @@ impl<T: ?Sized, A: Allocator> Weak<T, A> {
32913287
#[must_use]
32923288
#[stable(feature = "weak_counts", since = "1.41.0")]
32933289
pub fn strong_count(&self) -> usize {
3294-
if let Some(inner) = self.inner() {
3295-
inner.strong()
3296-
} else {
3297-
0
3298-
}
3290+
if let Some(inner) = self.inner() { inner.strong() } else { 0 }
32993291
}
33003292

33013293
/// Gets the number of `Weak` pointers pointing to this allocation.

0 commit comments

Comments
 (0)