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:
@@ -392,7 +392,7 @@ impl<'a> State<'a> {
|
||||
&f.decl,
|
||||
None,
|
||||
&f.generic_params,
|
||||
&f.param_names[..],
|
||||
f.param_names,
|
||||
);
|
||||
}
|
||||
hir::TyKind::OpaqueDef(..) => self.s.word("/*impl Trait*/"),
|
||||
@@ -1200,7 +1200,7 @@ impl<'a> State<'a> {
|
||||
self.s.word("{");
|
||||
self.commasep_cmnt(
|
||||
Consistent,
|
||||
&fields[..],
|
||||
fields,
|
||||
|s, field| {
|
||||
s.ibox(INDENT_UNIT);
|
||||
if !field.is_shorthand {
|
||||
|
||||
Reference in New Issue
Block a user