Unnamed repository; edit this file 'description' to name the repository.
internal: Remove the redundant const parameter from `array_windows` calls
Co-authored-by: Chayim Refael Friedman <[email protected]>
| -rw-r--r-- | crates/hir/src/lib.rs | 2 | ||||
| -rw-r--r-- | crates/ide/src/move_item.rs | 2 | ||||
| -rw-r--r-- | crates/rust-analyzer/src/config.rs | 2 | ||||
| -rw-r--r-- | crates/span/src/map.rs | 2 | ||||
| -rw-r--r-- | xtask/src/tidy.rs | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 31122061a6..bbecc686b6 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -6849,7 +6849,7 @@ impl<'db> Layout<'db> { .into_iter() .flatten() .chain(iter::once((0, self.0.size.bytes()))) - .array_windows::<2>() + .array_windows() .filter_map(|[(i, start), (_, end)]| { let size = field_size(i)?; end.checked_sub(start)?.checked_sub(size) diff --git a/crates/ide/src/move_item.rs b/crates/ide/src/move_item.rs index 943b1153a1..1e628f4e97 100644 --- a/crates/ide/src/move_item.rs +++ b/crates/ide/src/move_item.rs @@ -119,7 +119,7 @@ fn swap_sibling_in_list<A: AstNode + Clone, I: Iterator<Item = A>>( range: TextRange, direction: Direction, ) -> Option<TextEdit> { - let list_lookup = list.array_windows::<2>().find(|[l, r]| match direction { + let list_lookup = list.array_windows().find(|[l, r]| match direction { Direction::Up => r.syntax().text_range().contains_range(range), Direction::Down => l.syntax().text_range().contains_range(range), }); diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index 28baefe7a5..5fc17a52b9 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs @@ -3501,7 +3501,7 @@ impl FullConfigInput { fields.sort_by_key(|&(x, ..)| x); fields .iter() - .array_windows::<2>() + .array_windows() .for_each(|[a, b]| assert!(a.0 != b.0, "{a:?} duplicate field")); fields } diff --git a/crates/span/src/map.rs b/crates/span/src/map.rs index f13df88768..d874b73642 100644 --- a/crates/span/src/map.rs +++ b/crates/span/src/map.rs @@ -30,7 +30,7 @@ impl SpanMap { /// in order. pub fn finish(&mut self) { always!( - self.spans.iter().array_windows::<2>().all(|[a, b]| a.0 < b.0), + self.spans.iter().array_windows().all(|[a, b]| a.0 < b.0), "spans are not in order" ); self.spans.shrink_to_fit(); diff --git a/xtask/src/tidy.rs b/xtask/src/tidy.rs index a4e0623d82..73ae70ca0e 100644 --- a/xtask/src/tidy.rs +++ b/xtask/src/tidy.rs @@ -205,7 +205,7 @@ fn check_test_attrs(path: &Path, text: &str) { } if let Some((line, _)) = text .lines() - .array_windows::<2>() + .array_windows() .enumerate() .find(|(_, [a, b])| b.contains("#[should_panic") && !a.contains("FIXME")) { |