aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2015-07-14 16:19:29 +0200
committerMs2ger <ms2ger@gmail.com>2015-07-14 16:19:30 +0200
commitce4d442941616fb5e04d899dae70a862dfface7d (patch)
treefd19e5cfc7751995f2eec992335f094534bbbdab /components/script/dom
parent6a728712f9c9cbe667c1bca2465cefef6f6f657a (diff)
downloadservo-ce4d442941616fb5e04d899dae70a862dfface7d.tar.gz
servo-ce4d442941616fb5e04d899dae70a862dfface7d.zip
Move away from the repeat().take().collect() pattern.
This was the preferred pattern between the deprecation of Vec::from_elem and the addition of the count argument to the vec![] macro.
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index 8b7b427f689..aa0c682c561 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -5232,7 +5232,6 @@ class CGBindingRoot(CGThing):
'util::str::DOMString',
'std::borrow::ToOwned',
'std::cmp',
- 'std::iter::repeat',
'std::mem',
'std::num',
'std::ptr',
@@ -5555,7 +5554,7 @@ class CallbackMember(CGNativeMember):
if self.argCount > 0:
replacements["argCount"] = self.argCountStr
replacements["argvDecl"] = string.Template(
- "let mut argv = repeat(UndefinedValue()).take(${argCount}).collect::<Vec<_>>();\n"
+ "let mut argv = vec![UndefinedValue(); ${argCount}];\n"
).substitute(replacements)
else:
# Avoid weird 0-sized arrays