Skip to content

Commit 165842b

Browse files
committed
Use slice::from_ref instead of cloning
1 parent 9f8cd9d commit 165842b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/libsyntax/ext/tt/macro_rules.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ use log::debug;
2323
use rustc_data_structures::fx::{FxHashMap};
2424
use std::borrow::Cow;
2525
use std::collections::hash_map::Entry;
26+
use std::slice;
2627

2728
use rustc_data_structures::sync::Lrc;
2829
use errors::Applicability;
@@ -358,10 +359,10 @@ pub fn compile(
358359

359360
// don't abort iteration early, so that errors for multiple lhses can be reported
360361
for lhs in &lhses {
361-
valid &= check_lhs_no_empty_seq(sess, &[lhs.clone()]);
362+
valid &= check_lhs_no_empty_seq(sess, slice::from_ref(lhs));
362363
valid &= check_lhs_duplicate_matcher_bindings(
363364
sess,
364-
&[lhs.clone()],
365+
slice::from_ref(lhs),
365366
&mut FxHashMap::default(),
366367
def.id
367368
);

0 commit comments

Comments
 (0)