Remove intrinsic Root::r()

This commit is contained in:
Anthony Ramine 2016-05-13 14:20:00 +02:00
parent 51bcf516c8
commit 0b3ab875f4
55 changed files with 275 additions and 310 deletions

View file

@ -473,7 +473,7 @@ impl<T: Reflectable> RootedReference<T> for Option<Rc<T>> {
impl<T: Reflectable> RootedReference<T> for Option<Root<T>> {
fn r(&self) -> Option<&T> {
self.as_ref().map(|root| root.r())
self.as_ref().map(|root| &**root)
}
}
@ -615,12 +615,6 @@ impl<T: Reflectable> Root<T> {
pub fn from_ref(unrooted: &T) -> Root<T> {
Root::new(unsafe { NonZero::new(&*unrooted) })
}
/// Obtain a safe reference to the wrapped JS owned-value that cannot
/// outlive the lifetime of this root.
pub fn r(&self) -> &T {
&**self
}
}
impl<T: Reflectable> Deref for Root<T> {