aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/CodegenRust.py
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2015-02-15 23:18:37 +0100
committerMs2ger <ms2ger@gmail.com>2015-02-15 23:18:37 +0100
commit746c3ebd7d432af096447f70f0ae9630aa55091a (patch)
tree03bfacb36f6708dd2833ce3654b2934a71146d93 /components/script/dom/bindings/codegen/CodegenRust.py
parent5b2f2c55057493a6d6b1b56d02173625fbe403a8 (diff)
downloadservo-746c3ebd7d432af096447f70f0ae9630aa55091a.tar.gz
servo-746c3ebd7d432af096447f70f0ae9630aa55091a.zip
Improve the formatting for FromJSValConvertible implementations in UnionTypes.
Diffstat (limited to 'components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index 858b77f88b1..46731cf9824 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -3015,8 +3015,11 @@ class CGUnionConversionStruct(CGThing):
pre="fn from_jsval(cx: *mut JSContext, value: JSVal, _option: ()) -> Result<%s, ()> {\n" % self.type,
post="\n}")
return CGWrapper(
- CGIndenter(method),
- pre="impl FromJSValConvertible for %s {\ntype Config = ();\n" % self.type,
+ CGIndenter(CGList([
+ CGGeneric("type Config = ();"),
+ method,
+ ], "\n")),
+ pre="impl FromJSValConvertible for %s {\n" % self.type,
post="\n}")
def try_method(self, t):