From: topecongiro Date: Thu, 26 Oct 2017 07:57:11 +0000 (+0900) Subject: Prefer &[T] to &Vec X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=d66161c6a3cbc1d3d2c34d63df8c7b4d4a71a211;p=rust.git Prefer &[T] to &Vec --- diff --git a/src/imports.rs b/src/imports.rs index a44206df049..faf0638f7d1 100644 --- a/src/imports.rs +++ b/src/imports.rs @@ -75,11 +75,11 @@ fn compare_path_list_items(a: &ast::PathListItem, b: &ast::PathListItem) -> Orde } fn compare_path_list_item_lists( - a_items: &Vec, - b_items: &Vec, + a_items: &[ast::PathListItem], + b_items: &[ast::PathListItem], ) -> Ordering { - let mut a = a_items.clone(); - let mut b = b_items.clone(); + let mut a = a_items.to_owned(); + let mut b = b_items.to_owned(); a.sort_by(|a, b| compare_path_list_items(a, b)); b.sort_by(|a, b| compare_path_list_items(a, b)); for comparison_pair in a.iter().zip(b.iter()) {