mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Generalise RootedVec::<JS<T>>::r as [JS<T>]::r
This commit is contained in:
parent
45c9aa7487
commit
3a547cc113
2 changed files with 8 additions and 9 deletions
|
@ -461,6 +461,13 @@ pub trait RootedReference<'root> {
|
|||
fn r(&'root self) -> Self::Ref;
|
||||
}
|
||||
|
||||
impl<'root, T: JSTraceable + Reflectable + 'root> RootedReference<'root> for [JS<T>] {
|
||||
type Ref = &'root [&'root T];
|
||||
fn r(&'root self) -> &'root [&'root T] {
|
||||
unsafe { mem::transmute(self) }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'root, T: Reflectable + 'root> RootedReference<'root> for Rc<T> {
|
||||
type Ref = &'root T;
|
||||
fn r(&'root self) -> &'root T {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue