about summary refs log tree commit diff
path: root/compiler/rustc_target/src/spec
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-02-16 00:30:06 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2021-02-16 00:31:11 +0100
commit4390a61b6495765a04819130e3934ec671428bcd (patch)
treefefce73ac7189d67d0df532cd95f9136a11aca77 /compiler/rustc_target/src/spec
parentd1206f950ffb76c76e1b74a19ae33c2b7d949454 (diff)
downloadrust-4390a61b6495765a04819130e3934ec671428bcd.tar.gz
rust-4390a61b6495765a04819130e3934ec671428bcd.zip
avoid full-slicing slices
If we already have a slice, there is no need to get another full-range slice from that, just use the original.
clippy::redundant_slicing
Diffstat (limited to 'compiler/rustc_target/src/spec')
-rw-r--r--compiler/rustc_target/src/spec/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
index 0e55c4ec0b7..c5dbd3ed089 100644
--- a/compiler/rustc_target/src/spec/mod.rs
+++ b/compiler/rustc_target/src/spec/mod.rs
@@ -1492,7 +1492,7 @@ impl Target {
             } );
             ($key_name:ident = $json_name:expr, optional) => ( {
                 let name = $json_name;
-                if let Some(o) = obj.find(&name[..]) {
+                if let Some(o) = obj.find(name) {
                     base.$key_name = o
                         .as_string()
                         .map(|s| s.to_string() );