mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Remove intrinsic Root::r()
This commit is contained in:
parent
51bcf516c8
commit
0b3ab875f4
55 changed files with 275 additions and 310 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue