aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/bindings/codegen
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/script/dom/bindings/codegen')
-rw-r--r--src/components/script/dom/bindings/codegen/CodegenRust.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py
index 21c432a2e72..2fcb72383b6 100644
--- a/src/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/src/components/script/dom/bindings/codegen/CodegenRust.py
@@ -757,13 +757,8 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
assert not isEnforceRange and not isClamp
declType = CGGeneric("JSVal")
- value = CGGeneric("${val}")
- if isOptional:
- declType = CGWrapper(declType, pre="Option<", post=">")
- value = CGWrapper(value, pre="Some(", post=")")
-
- templateBody = handleDefaultNull(value.define(), "NullValue()")
- return (templateBody, declType, isOptional, "None" if isOptional else None)
+ templateBody = handleDefaultNull("${val}", "NullValue()")
+ return handleOptional(templateBody, declType, isOptional)
if type.isObject():
raise TypeError("Can't handle object arguments yet")