Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 8800ea6

Browse files
committed
Auto merge of rust-lang#13950 - WaffleLapkin:iterate_over_arrays_directly, r=Veykril
minor: Iterate over arrays dirrectly, instead of going through a slice Minor code improvement.
2 parents 6673e51 + bd04416 commit 8800ea6

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

crates/hir-ty/src/infer/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ impl<'a> InferenceContext<'a> {
12691269
// that are not closures, then we type-check the closures. This is so
12701270
// that we have more information about the types of arguments when we
12711271
// type-check the functions. This isn't really the right way to do this.
1272-
for &check_closures in &[false, true] {
1272+
for check_closures in [false, true] {
12731273
let mut skip_indices = skip_indices.into_iter().copied().fuse().peekable();
12741274
let param_iter = param_tys.iter().cloned().chain(repeat(self.err_ty()));
12751275
let expected_iter = expected_inputs

crates/ide-completion/src/completions/item_list/trait_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ impl Test for T {{
869869
};
870870

871871
// Enumerate some possible next siblings.
872-
for next_sibling in &[
872+
for next_sibling in [
873873
"",
874874
"fn other_fn() {}", // `const $0 fn` -> `const fn`
875875
"type OtherType = i32;",

crates/ide-db/src/line_index.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,14 @@ mod tests {
185185
];
186186

187187
let index = LineIndex::new(text);
188-
for &(offset, line, col) in &table {
188+
for (offset, line, col) in table {
189189
assert_eq!(index.line_col(offset.into()), LineCol { line, col });
190190
}
191191

192192
let text = "\nhello\nworld";
193193
let table = [(0, 0, 0), (1, 1, 0), (2, 1, 1), (6, 1, 5), (7, 2, 0)];
194194
let index = LineIndex::new(text);
195-
for &(offset, line, col) in &table {
195+
for (offset, line, col) in table {
196196
assert_eq!(index.line_col(offset.into()), LineCol { line, col });
197197
}
198198
}

xtask/src/release/changelog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ fn parse_title_line(s: &str) -> PrInfo {
156156
("minor: ", PrKind::Skip),
157157
];
158158

159-
for &(prefix, kind) in &PREFIXES {
159+
for (prefix, kind) in PREFIXES {
160160
if lower.starts_with(prefix) {
161161
let message = match &kind {
162162
PrKind::Skip => None,

0 commit comments

Comments
 (0)