mirror of
https://github.com/servo/servo.git
synced 2025-06-25 01:24:37 +01:00
Fix return types of Owned<T>::into_box Gecko sugar types.
This commit is contained in:
parent
cad5a4e326
commit
ef357f5372
1 changed files with 2 additions and 2 deletions
|
@ -204,7 +204,7 @@ pub struct Owned<T> {
|
|||
|
||||
impl<T> Owned<T> {
|
||||
/// Owned<GeckoType> -> Box<ServoType>
|
||||
pub fn into_box<U>(self) -> Box<T> where U: HasBoxFFI<FFIType = T> {
|
||||
pub fn into_box<U>(self) -> Box<U> where U: HasBoxFFI<FFIType = T> {
|
||||
unsafe { transmute(self) }
|
||||
}
|
||||
pub fn maybe(self) -> OwnedOrNull<T> {
|
||||
|
@ -238,7 +238,7 @@ impl<T> OwnedOrNull<T> {
|
|||
self.ptr == ptr::null_mut()
|
||||
}
|
||||
/// OwnedOrNull<GeckoType> -> Option<Box<ServoType>>
|
||||
pub fn into_box_opt<U>(self) -> Option<Box<T>> where U: HasBoxFFI<FFIType = T> {
|
||||
pub fn into_box_opt<U>(self) -> Option<Box<U>> where U: HasBoxFFI<FFIType = T> {
|
||||
if self.is_null() {
|
||||
None
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue