Do not collect into a Vec by hand

This commit is contained in:
Shotaro Yamada 2018-04-01 19:35:00 +09:00
parent 89200f40ff
commit a2325375ed

View File

@ -361,10 +361,7 @@ fn rewrite_tuple_pat(
// add comma if `(x,)`
let add_comma = path_str.is_none() && pat_vec.len() == 1 && dotdot_pos.is_none();
let path_str = path_str.unwrap_or_default();
let mut pat_ref_vec = Vec::with_capacity(pat_vec.len());
for pat in pat_vec {
pat_ref_vec.push(pat);
}
let pat_ref_vec = pat_vec.iter().collect::<Vec<_>>();
overflow::rewrite_with_parens(
&context,