aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/bindings/codegen
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2014-08-04 14:39:04 +0200
committerMs2ger <ms2ger@gmail.com>2014-08-05 16:23:01 +0200
commitdb3078fde4c3428539041d1611c82977d5165b9e (patch)
treefdb90439fdec2309b90193ccbc49e04f8ffe9d6e /src/components/script/dom/bindings/codegen
parente7c23296491e67ba1c30bf471988fd23f4c11f1d (diff)
downloadservo-db3078fde4c3428539041d1611c82977d5165b9e.tar.gz
servo-db3078fde4c3428539041d1611c82977d5165b9e.zip
Fix the double indentation in CastableObjectUnwrapper.
The current code indents the first line of codeOnFailure four spaces too far.
Diffstat (limited to 'src/components/script/dom/bindings/codegen')
-rw-r--r--src/components/script/dom/bindings/codegen/CodegenRust.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py
index 42175de35e4..29d40b33ec7 100644
--- a/src/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/src/components/script/dom/bindings/codegen/CodegenRust.py
@@ -101,19 +101,21 @@ class CastableObjectUnwrapper():
codeOnFailure is the code to run if unwrapping fails.
"""
def __init__(self, descriptor, source, codeOnFailure):
- self.substitution = { "type" : descriptor.nativeType,
- "depth": descriptor.interface.inheritanceDepth(),
- "prototype": "PrototypeList::id::" + descriptor.name,
- "protoID" : "PrototypeList::id::" + descriptor.name + " as uint",
- "source" : source,
- "codeOnFailure" : CGIndenter(CGGeneric(codeOnFailure), 4).define()}
+ self.substitution = {
+ "type": descriptor.nativeType,
+ "depth": descriptor.interface.inheritanceDepth(),
+ "prototype": "PrototypeList::id::" + descriptor.name,
+ "protoID": "PrototypeList::id::" + descriptor.name + " as uint",
+ "source": source,
+ "codeOnFailure": CGIndenter(CGGeneric(codeOnFailure), 4).define(),
+ }
def __str__(self):
return string.Template(
"""match unwrap_jsmanaged(${source}, ${prototype}, ${depth}) {
Ok(val) => val,
Err(()) => {
- ${codeOnFailure}
+${codeOnFailure}
}
}""").substitute(self.substitution)