aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/CodegenRust.py
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index 3d28cf2bdc9..e1e5bee2036 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -674,7 +674,7 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
default = "None"
else:
assert defaultValue.type.tag() == IDLType.Tags.domstring
- value = "str::from_utf8(&data).unwrap().into_string()"
+ value = "str::from_utf8(&data).unwrap().to_owned()"
if type.nullable():
value = "Some(%s)" % value
@@ -4584,6 +4584,7 @@ class CGBindingRoot(CGThing):
'page::JSPageInfo',
'libc',
'servo_util::str::DOMString',
+ 'std::borrow::ToOwned',
'std::cmp',
'std::iter::repeat',
'std::mem',