Rollup merge of #61866 - sinkuu:redundant_clone, r=petrochenkov

Remove redundant `clone()`s
This commit is contained in:
Mazdak Farrokhzad 2019-06-16 06:05:18 +02:00 committed by GitHub
commit 2ba1d94f7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 17 additions and 16 deletions

View file

@ -23,6 +23,7 @@ use log::debug;
use rustc_data_structures::fx::{FxHashMap};
use std::borrow::Cow;
use std::collections::hash_map::Entry;
use std::slice;
use rustc_data_structures::sync::Lrc;
use errors::Applicability;
@ -359,10 +360,10 @@ pub fn compile(
// don't abort iteration early, so that errors for multiple lhses can be reported
for lhs in &lhses {
valid &= check_lhs_no_empty_seq(sess, &[lhs.clone()]);
valid &= check_lhs_no_empty_seq(sess, slice::from_ref(lhs));
valid &= check_lhs_duplicate_matcher_bindings(
sess,
&[lhs.clone()],
slice::from_ref(lhs),
&mut FxHashMap::default(),
def.id
);