mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
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.
This commit is contained in:
parent
6a728712f9
commit
ce4d442941
6 changed files with 7 additions and 16 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue