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:
parent
d1206f950f
commit
4390a61b64
19 changed files with 33 additions and 40 deletions
|
@ -135,7 +135,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
|
||||
let parent_generics = match self.items.get(&parent_hir_id).unwrap().kind {
|
||||
hir::ItemKind::Impl(hir::Impl { ref generics, .. })
|
||||
| hir::ItemKind::Trait(_, _, ref generics, ..) => &generics.params[..],
|
||||
| hir::ItemKind::Trait(_, _, ref generics, ..) => generics.params,
|
||||
_ => &[],
|
||||
};
|
||||
let lt_def_names = parent_generics.iter().filter_map(|param| match param.kind {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue