diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-03-13 08:42:49 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-03-13 08:42:49 -0600 |
commit | c05de08630c50446cb15e42f4948fae6039e7271 (patch) | |
tree | 239dcc2510f88366ce3a3116caf60911f05d89cb /components | |
parent | 5f439e7eaa02245f64d5041d3d4e6dec51dfb993 (diff) | |
parent | 6eb9607bb9aca6b1002c7b18748d25665ea647c1 (diff) | |
download | servo-c05de08630c50446cb15e42f4948fae6039e7271.tar.gz servo-c05de08630c50446cb15e42f4948fae6039e7271.zip |
auto merge of #5206 : Ms2ger/servo/pre-rustup-codegen-cleanup, r=jdm,SimonSapin
Diffstat (limited to 'components')
-rw-r--r-- | components/script/dom/bindings/codegen/CodegenRust.py | 25 | ||||
-rw-r--r-- | components/script/dom/nodeiterator.rs | 7 |
2 files changed, 15 insertions, 17 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py index f1ec208b3b2..fa6c0475000 100644 --- a/components/script/dom/bindings/codegen/CodegenRust.py +++ b/components/script/dom/bindings/codegen/CodegenRust.py @@ -4150,13 +4150,16 @@ class CGInterfaceTrait(CGThing): def fmt(arguments): return "".join(", %s: %s" % argument for argument in arguments) - methods = CGList([ + methods = [ CGGeneric("fn %s(self%s) -> %s;\n" % (name, fmt(arguments), rettype)) for name, arguments, rettype in members() - ], "") - self.cgRoot = CGWrapper(CGIndenter(methods), - pre="pub trait %sMethods {\n" % descriptor.interface.identifier.name, - post="}") + ] + if methods: + self.cgRoot = CGWrapper(CGIndenter(CGList(methods, "")), + pre="pub trait %sMethods {\n" % descriptor.interface.identifier.name, + post="}") + else: + self.cgRoot = CGGeneric("") def define(self): return self.cgRoot.define() @@ -4362,8 +4365,8 @@ class CGDictionary(CGThing): def struct(self): d = self.dictionary if d.parent: - inheritance = " pub parent: %s::%s<'a, 'b>,\n" % (self.makeModuleName(d.parent), - self.makeClassName(d.parent)) + inheritance = " pub parent: %s::%s,\n" % (self.makeModuleName(d.parent), + self.makeClassName(d.parent)) else: inheritance = "" memberDecls = [" pub %s: %s," % @@ -4371,7 +4374,7 @@ class CGDictionary(CGThing): for m in self.memberInfo] return (string.Template( - "pub struct ${selfName}<'a, 'b> {\n" + + "pub struct ${selfName} {\n" + "${inheritance}" + "\n".join(memberDecls) + "\n" + "}").substitute( { "selfName": self.makeClassName(d), @@ -4395,11 +4398,11 @@ class CGDictionary(CGThing): memberInits = CGList([memberInit(m) for m in self.memberInfo]) return string.Template( - "impl<'a, 'b> ${selfName}<'a, 'b> {\n" - " pub fn empty() -> ${selfName}<'a, 'b> {\n" + "impl ${selfName} {\n" + " pub fn empty() -> ${selfName} {\n" " ${selfName}::new(ptr::null_mut(), NullValue()).unwrap()\n" " }\n" - " pub fn new(cx: *mut JSContext, val: JSVal) -> Result<${selfName}<'a, 'b>, ()> {\n" + " pub fn new(cx: *mut JSContext, val: JSVal) -> Result<${selfName}, ()> {\n" " let object = if val.is_null_or_undefined() {\n" " ptr::null_mut()\n" " } else if val.is_object() {\n" diff --git a/components/script/dom/nodeiterator.rs b/components/script/dom/nodeiterator.rs index 5734bc89c9e..374fbafab42 100644 --- a/components/script/dom/nodeiterator.rs +++ b/components/script/dom/nodeiterator.rs @@ -3,9 +3,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::Bindings::NodeIteratorBinding; -use dom::bindings::codegen::Bindings::NodeIteratorBinding::NodeIteratorMethods; use dom::bindings::global::GlobalRef; -use dom::bindings::js::{JSRef, Temporary}; +use dom::bindings::js::Temporary; use dom::bindings::utils::{Reflector, reflect_dom_object}; #[dom_struct] @@ -24,7 +23,3 @@ impl NodeIterator { reflect_dom_object(box NodeIterator::new_inherited(), global, NodeIteratorBinding::Wrap) } } - -impl<'a> NodeIteratorMethods for JSRef<'a, NodeIterator> { -} - |