Skip to content
Permalink
Browse files

remove unreachable code in codegen

code is unreachable after return, and identical to the upper block
  • Loading branch information...
amarant committed Apr 12, 2016
1 parent dfb482a commit 315120d6e8fa2572e117a31daf05295f01ccf6d3
Showing with 0 additions and 16 deletions.
  1. +0 −16 components/script/dom/bindings/codegen/CodegenRust.py
@@ -3800,22 +3800,6 @@ def getStringOrPrimitiveConversion(memberType):
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"]

0 comments on commit 315120d

Please sign in to comment.
You can’t perform that action at this time.