Fix refcell_backtrace feature.

This commit is contained in:
Josh Matthews 2020-06-18 12:56:33 -04:00 committed by GitHub
parent 06c948eab3
commit da3b3e3985
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,8 +75,7 @@ impl<T> DomRefCell<T> {
/// ///
/// Panics if the value is currently mutably borrowed. /// Panics if the value is currently mutably borrowed.
pub fn borrow(&self) -> Ref<T> { pub fn borrow(&self) -> Ref<T> {
self.try_borrow() self.value.borrow()
.expect("DomRefCell<T> already mutably borrowed")
} }
/// Mutably borrows the wrapped value. /// Mutably borrows the wrapped value.
@ -90,8 +89,7 @@ impl<T> DomRefCell<T> {
/// ///
/// Panics if the value is currently borrowed. /// Panics if the value is currently borrowed.
pub fn borrow_mut(&self) -> RefMut<T> { pub fn borrow_mut(&self) -> RefMut<T> {
self.try_borrow_mut() self.value.borrow_mut()
.expect("DomRefCell<T> already borrowed")
} }
/// Attempts to immutably borrow the wrapped value. /// Attempts to immutably borrow the wrapped value.