diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-02-16 00:30:06 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2021-02-16 00:31:11 +0100 |
| commit | 4390a61b6495765a04819130e3934ec671428bcd (patch) | |
| tree | fefce73ac7189d67d0df532cd95f9136a11aca77 /compiler/rustc_target/src/spec | |
| parent | d1206f950ffb76c76e1b74a19ae33c2b7d949454 (diff) | |
| download | rust-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.rs | 2 |
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() ); |
