Rollup merge of #91625 - est31:remove_indexes, r=oli-obk

Remove redundant [..]s
This commit is contained in:
Matthias Krüger 2021-12-10 22:40:36 +01:00 committed by GitHub
commit 40988591ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 123 additions and 127 deletions

View file

@ -316,7 +316,7 @@ impl<'a> State<'a> {
}
hir::TyKind::Tup(ref elts) => {
self.popen();
self.commasep(Inconsistent, &elts[..], |s, ty| s.print_type(&ty));
self.commasep(Inconsistent, &elts, |s, ty| s.print_type(&ty));
if elts.len() == 1 {
self.word(",");
}
@ -1860,7 +1860,7 @@ impl<'a> State<'a> {
self.commasep(Inconsistent, &elts[ddpos..], |s, p| s.print_pat(&p));
}
} else {
self.commasep(Inconsistent, &elts[..], |s, p| s.print_pat(&p));
self.commasep(Inconsistent, &elts, |s, p| s.print_pat(&p));
}
self.pclose();
}
@ -1873,7 +1873,7 @@ impl<'a> State<'a> {
self.word_space("{");
self.commasep_cmnt(
Consistent,
&fields[..],
&fields,
|s, f| {
s.cbox(INDENT_UNIT);
if !f.is_shorthand {
@ -1895,7 +1895,7 @@ impl<'a> State<'a> {
self.word("}");
}
PatKind::Or(ref pats) => {
self.strsep("|", true, Inconsistent, &pats[..], |s, p| s.print_pat(&p));
self.strsep("|", true, Inconsistent, &pats, |s, p| s.print_pat(&p));
}
PatKind::Tuple(ref elts, ddpos) => {
self.popen();
@ -1956,7 +1956,7 @@ impl<'a> State<'a> {
}
PatKind::Slice(ref before, ref slice, ref after) => {
self.word("[");
self.commasep(Inconsistent, &before[..], |s, p| s.print_pat(&p));
self.commasep(Inconsistent, &before, |s, p| s.print_pat(&p));
if let Some(ref p) = *slice {
if !before.is_empty() {
self.word_space(",");
@ -1971,7 +1971,7 @@ impl<'a> State<'a> {
self.word_space(",");
}
}
self.commasep(Inconsistent, &after[..], |s, p| s.print_pat(&p));
self.commasep(Inconsistent, &after, |s, p| s.print_pat(&p));
self.word("]");
}
}