mirror of
https://github.com/servo/servo
synced 2026-05-03 04:42:17 +02:00
Generate from_layout_js() conversion methods
This commit is contained in:
@@ -5427,6 +5427,12 @@ impl ${name}Cast {
|
||||
unsafe { derived.transmute_borrowed() }
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn from_layout_js<T: ${fromBound}+Reflectable>(derived: &LayoutJS<T>) -> LayoutJS<${name}> {
|
||||
unsafe { derived.transmute_copy() }
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn from_temporary<T: ${fromBound}+Reflectable>(derived: Temporary<T>) -> Temporary<${name}> {
|
||||
unsafe { derived.transmute() }
|
||||
|
||||
Reference in New Issue
Block a user