Don't use RootedReference for Option<T> in codegen anymore

This commit is contained in:
Anthony Ramine 2019-03-10 18:24:35 +01:00
parent 5fe5e5d6de
commit 1744a42dad
2 changed files with 4 additions and 16 deletions

View file

@ -264,13 +264,6 @@ pub trait RootedReference<'root> {
fn r(&'root self) -> Self::Ref;
}
impl<'root, T: DomObject + 'root> RootedReference<'root> for DomRoot<T> {
type Ref = &'root T;
fn r(&'root self) -> &'root T {
self
}
}
impl<'root, T: JSTraceable + DomObject + 'root> RootedReference<'root> for [Dom<T>] {
type Ref = &'root [&'root T];
fn r(&'root self) -> &'root [&'root T] {
@ -278,13 +271,6 @@ impl<'root, T: JSTraceable + DomObject + 'root> RootedReference<'root> for [Dom<
}
}
impl<'root, T: RootedReference<'root> + 'root> RootedReference<'root> for Option<T> {
type Ref = Option<T::Ref>;
fn r(&'root self) -> Option<T::Ref> {
self.as_ref().map(RootedReference::r)
}
}
/// A traced reference to a DOM object
///
/// This type is critical to making garbage collection work with the DOM,