Skip to content

Commit e17cd0c

Browse files
committed
be nice and don't slice
These are already slices, no need to slice them again
1 parent 2d14db3 commit e17cd0c

File tree

1 file changed

+2
-2
lines changed
  • compiler/rustc_hir_analysis/src/astconv

1 file changed

+2
-2
lines changed

compiler/rustc_hir_analysis/src/astconv/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1970,7 +1970,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
19701970
) = &qself.kind {
19711971
// If the path segment already has type params, we want to overwrite
19721972
// them.
1973-
match &path.segments[..] {
1973+
match &path.segments {
19741974
// `segment` is the previous to last element on the path,
19751975
// which would normally be the `enum` itself, while the last
19761976
// `_` `PathSegment` corresponds to the variant.
@@ -2671,7 +2671,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
26712671
// `Self` in trait or type alias.
26722672
assert_eq!(opt_self_ty, None);
26732673
self.prohibit_generics(path.segments.iter(), |err| {
2674-
if let [hir::PathSegment { args: Some(args), ident, .. }] = &path.segments[..] {
2674+
if let [hir::PathSegment { args: Some(args), ident, .. }] = &path.segments {
26752675
err.span_suggestion_verbose(
26762676
ident.span.shrink_to_hi().to(args.span_ext),
26772677
"the `Self` type doesn't accept type parameters",

0 commit comments

Comments
 (0)