diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py index 2bac83bc278..af6af8118cc 100644 --- a/components/script/dom/bindings/codegen/CodegenRust.py +++ b/components/script/dom/bindings/codegen/CodegenRust.py @@ -1920,10 +1920,10 @@ class CGIDLInterface(CGThing): } return string.Template("""\ impl IDLInterface for ${type} { - fn get_prototype_id(_: Option<${type}>) -> PrototypeList::ID { + fn get_prototype_id() -> PrototypeList::ID { PrototypeList::ID::${type} } - fn get_prototype_depth(_: Option<${type}>) -> uint { + fn get_prototype_depth() -> uint { ${depth} } } diff --git a/components/script/dom/bindings/conversions.rs b/components/script/dom/bindings/conversions.rs index 62f71cea5d6..e60584a6416 100644 --- a/components/script/dom/bindings/conversions.rs +++ b/components/script/dom/bindings/conversions.rs @@ -57,14 +57,12 @@ use std::slice; /// A trait to retrieve the constants necessary to check if a `JSObject` /// implements a given interface. -// FIXME (https://github.com/rust-lang/rfcs/pull/4) -// remove Option arguments. pub trait IDLInterface { /// Returns the prototype ID. - fn get_prototype_id(_: Option) -> PrototypeList::ID; + fn get_prototype_id() -> PrototypeList::ID; /// Returns the prototype depth, i.e., the number of interfaces this /// interface inherits from. - fn get_prototype_depth(_: Option) -> uint; + fn get_prototype_depth() -> uint; } /// A trait to convert Rust types to `JSVal`s. @@ -489,8 +487,8 @@ pub fn unwrap_jsmanaged(mut obj: *mut JSObject) -> Result, ()> } })); - let proto_id = IDLInterface::get_prototype_id(None::); - let proto_depth = IDLInterface::get_prototype_depth(None::); + let proto_id = ::get_prototype_id(); + let proto_depth = ::get_prototype_depth(); if dom_class.interface_chain[proto_depth] == proto_id { debug!("good prototype"); Ok(Unrooted::from_raw(unwrap(obj)))