diff options
author | Ms2ger <ms2ger@gmail.com> | 2015-02-15 23:18:37 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2015-02-15 23:18:37 +0100 |
commit | 746c3ebd7d432af096447f70f0ae9630aa55091a (patch) | |
tree | 03bfacb36f6708dd2833ce3654b2934a71146d93 /components/script/dom/bindings/codegen/CodegenRust.py | |
parent | 5b2f2c55057493a6d6b1b56d02173625fbe403a8 (diff) | |
download | servo-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.py | 7 |
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): |