aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/CodegenRust.py
diff options
context:
space:
mode:
authorArnaud Marant <arnaudmarant@gmail.com>2016-04-12 19:10:10 +0200
committerArnaud Marant <arnaudmarant@gmail.com>2016-04-12 19:10:10 +0200
commit315120d6e8fa2572e117a31daf05295f01ccf6d3 (patch)
treee46af7756d1bda364d8cc75d8e77790ddc23e96b /components/script/dom/bindings/codegen/CodegenRust.py
parentdfb482a2b7fdb570f34e9092384fa74a3e1b54e3 (diff)
downloadservo-315120d6e8fa2572e117a31daf05295f01ccf6d3.tar.gz
servo-315120d6e8fa2572e117a31daf05295f01ccf6d3.zip
remove unreachable code in codegen
code is unreachable after return, and identical to the upper block
Diffstat (limited to 'components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py16
1 files changed, 0 insertions, 16 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index 51c29764125..57b7be5c7bb 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -3800,22 +3800,6 @@ class CGUnionConversionStruct(CGThing):
pre="impl FromJSValConvertible for %s {\n" % self.type,
post="\n}")
- conversions.append(CGGeneric(
- "throw_not_in_union(cx, \"%s\");\n"
- "Err(())" % ", ".join(names)))
- method = CGWrapper(
- CGIndenter(CGList(conversions, "\n\n")),
- pre="unsafe fn from_jsval(cx: *mut JSContext,\n"
- " value: HandleValue, _option: ()) -> Result<%s, ()> {\n" % self.type,
- post="\n}")
- return CGWrapper(
- CGIndenter(CGList([
- CGGeneric("type Config = ();"),
- method,
- ], "\n")),
- pre="impl FromJSValConvertible for %s {\n" % self.type,
- post="\n}")
-
def try_method(self, t):
templateVars = getUnionTypeTemplateVars(t, self.descriptorProvider)
returnType = "Result<Option<%s>, ()>" % templateVars["typeName"]