Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use slice::from_ref instead of cloning
  • Loading branch information
sinkuu committed Jun 15, 2019
1 parent 9f8cd9d commit 165842b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libsyntax/ext/tt/macro_rules.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -358,10 +359,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
);
Expand Down

0 comments on commit 165842b

Please sign in to comment.