Skip to content

Commit

Permalink
fix wording on panics in binary operators on RefCells"
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Feb 27, 2018
1 parent bde8555 commit f8ebb3f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/libcore/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ impl<T:Default> Default for RefCell<T> {
impl<T: ?Sized + PartialEq> PartialEq for RefCell<T> {
/// # Panics
///
/// Panics if the value is currently mutably borrowed.
/// Panics if the value in either `RefCell` is currently borrowed.
#[inline]
fn eq(&self, other: &RefCell<T>) -> bool {
*self.borrow() == *other.borrow()
Expand All @@ -899,39 +899,39 @@ impl<T: ?Sized + Eq> Eq for RefCell<T> {}
impl<T: ?Sized + PartialOrd> PartialOrd for RefCell<T> {
/// # Panics
///
/// Panics if the value is currently mutably borrowed.
/// Panics if the value in either `RefCell` is currently borrowed.
#[inline]
fn partial_cmp(&self, other: &RefCell<T>) -> Option<Ordering> {
self.borrow().partial_cmp(&*other.borrow())
}

/// # Panics
///
/// Panics if the value is currently mutably borrowed.
/// Panics if the value in either `RefCell` is currently borrowed.
#[inline]
fn lt(&self, other: &RefCell<T>) -> bool {
*self.borrow() < *other.borrow()
}

/// # Panics
///
/// Panics if the value is currently mutably borrowed.
/// Panics if the value in either `RefCell` is currently borrowed.
#[inline]
fn le(&self, other: &RefCell<T>) -> bool {
*self.borrow() <= *other.borrow()
}

/// # Panics
///
/// Panics if the value is currently mutably borrowed.
/// Panics if the value in either `RefCell` is currently borrowed.
#[inline]
fn gt(&self, other: &RefCell<T>) -> bool {
*self.borrow() > *other.borrow()
}

/// # Panics
///
/// Panics if the value is currently mutably borrowed.
/// Panics if the value in either `RefCell` is currently borrowed.
#[inline]
fn ge(&self, other: &RefCell<T>) -> bool {
*self.borrow() >= *other.borrow()
Expand All @@ -942,7 +942,7 @@ impl<T: ?Sized + PartialOrd> PartialOrd for RefCell<T> {
impl<T: ?Sized + Ord> Ord for RefCell<T> {
/// # Panics
///
/// Panics if the value is currently mutably borrowed.
/// Panics if the value in either `RefCell` is currently borrowed.
#[inline]
fn cmp(&self, other: &RefCell<T>) -> Ordering {
self.borrow().cmp(&*other.borrow())
Expand Down

0 comments on commit f8ebb3f

Please sign in to comment.