diff options
| author | Shotaro Yamada <sinkuu@sinkuu.xyz> | 2019-06-08 18:37:37 +0900 |
|---|---|---|
| committer | Shotaro Yamada <sinkuu@sinkuu.xyz> | 2019-06-15 20:46:00 +0900 |
| commit | 165842ba1fe09b6e0f142dc3cb27597b85b96e85 (patch) | |
| tree | 7e90ee315a2e0ce65017a7b4d7dfd07c348fa100 /src/libsyntax | |
| parent | 9f8cd9da7b6380b5658163141c767a321f5f0f62 (diff) | |
| download | rust-165842ba1fe09b6e0f142dc3cb27597b85b96e85.tar.gz rust-165842ba1fe09b6e0f142dc3cb27597b85b96e85.zip | |
Use `slice::from_ref` instead of cloning
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/tt/macro_rules.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index 5dbf21867af..ae35d988810 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -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; @@ -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 ); |
