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
This commit is contained in:
Matthias Krüger 2021-02-16 00:30:06 +01:00
parent d1206f950f
commit 4390a61b64
19 changed files with 33 additions and 40 deletions

View file

@ -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() );