Skip to content

Commit

Permalink
Clean up &args[..], use more readable args.iter() instead
Browse files Browse the repository at this point in the history
  • Loading branch information
notriddle committed May 22, 2022
1 parent 3657d09 commit 207f649
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ impl Clean<Item> for ty::AssocItem {
|| generics
.params
.iter()
.zip(&args[..])
.zip(args.iter())
.any(|(param, arg)| !param_eq_arg(param, arg))
{
return false;
Expand Down
6 changes: 3 additions & 3 deletions src/librustdoc/html/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ impl clean::GenericArgs {
f.write_str("&lt;")?;
}
let mut comma = false;
for arg in &args[..] {
for arg in args.iter() {
if comma {
f.write_str(", ")?;
}
Expand All @@ -468,7 +468,7 @@ impl clean::GenericArgs {
write!(f, "{}", arg.print(cx))?;
}
}
for binding in &bindings[..] {
for binding in bindings.iter() {
if comma {
f.write_str(", ")?;
}
Expand All @@ -489,7 +489,7 @@ impl clean::GenericArgs {
clean::GenericArgs::Parenthesized { inputs, output } => {
f.write_str("(")?;
let mut comma = false;
for ty in &inputs[..] {
for ty in inputs.iter() {
if comma {
f.write_str(", ")?;
}
Expand Down

0 comments on commit 207f649

Please sign in to comment.