From da28a791e5d43579ab1538c86734a980b816d810 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 21 Jun 2014 10:32:21 +0200 Subject: [PATCH] Store the arrays of properties as &'static [T] rather than [T, ..N]. This means the .as_slice() call (which is problematic when storing the array in a static struct) is no longer necessary. --- src/components/script/dom/bindings/codegen/CodegenRust.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py index fda7fea34f8..725597b035b 100644 --- a/src/components/script/dom/bindings/codegen/CodegenRust.py +++ b/src/components/script/dom/bindings/codegen/CodegenRust.py @@ -1101,9 +1101,9 @@ class PropertyDefiner: if specTerminator: specs.append(specTerminator) - return (("static %s: [%s, ..%i] = [\n" + + return (("static %s: &'static [%s] = &[\n" + ",\n".join(specs) + "\n" + - "];\n\n") % (name, specType, len(specs))) + "];\n\n") % (name, specType)) # The length of a method is the maximum of the lengths of the # argument lists of all its overloads. @@ -1894,7 +1894,7 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod): val = ('%(' + name + ')s') % self.properties.variableNames() if val == "ptr::null()": return "None" - return "Some(%s.as_slice())" % val + return "Some(%s)" % val if needInterfaceObject: if self.descriptor.interface.ctor():