Unnamed repository; edit this file 'description' to name the repository.
| -rw-r--r-- | crates/hir/src/lib.rs | 4 | ||||
| -rw-r--r-- | crates/ide/src/move_item.rs | 4 | ||||
| -rw-r--r-- | crates/rust-analyzer/src/config.rs | 4 | ||||
| -rw-r--r-- | crates/span/src/map.rs | 2 | ||||
| -rw-r--r-- | xtask/src/tidy.rs | 4 |
5 files changed, 9 insertions, 9 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 8b01c5ae2d..31122061a6 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -6849,8 +6849,8 @@ impl<'db> Layout<'db> { .into_iter() .flatten() .chain(iter::once((0, self.0.size.bytes()))) - .tuple_windows() - .filter_map(|((i, start), (_, end))| { + .array_windows::<2>() + .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 b5d47c83a5..943b1153a1 100644 --- a/crates/ide/src/move_item.rs +++ b/crates/ide/src/move_item.rs @@ -119,12 +119,12 @@ fn swap_sibling_in_list<A: AstNode + Clone, I: Iterator<Item = A>>( range: TextRange, direction: Direction, ) -> Option<TextEdit> { - let list_lookup = list.tuple_windows().find(|(l, r)| match direction { + let list_lookup = list.array_windows::<2>().find(|[l, r]| match direction { Direction::Up => r.syntax().text_range().contains_range(range), Direction::Down => l.syntax().text_range().contains_range(range), }); - if let Some((l, r)) = list_lookup { + if let Some([l, r]) = list_lookup { Some(replace_nodes(range, l.syntax(), r.syntax())) } else { // Cursor is beyond any movable list item (for example, on curly brace in enum). diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index 6bdeb8ba07..28baefe7a5 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs @@ -3501,8 +3501,8 @@ impl FullConfigInput { fields.sort_by_key(|&(x, ..)| x); fields .iter() - .tuple_windows() - .for_each(|(a, b)| assert!(a.0 != b.0, "{a:?} duplicate field")); + .array_windows::<2>() + .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 d8309b04d4..f13df88768 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().tuple_windows().all(|(a, b)| a.0 < b.0), + self.spans.iter().array_windows::<2>().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 33145a8834..a4e0623d82 100644 --- a/xtask/src/tidy.rs +++ b/xtask/src/tidy.rs @@ -205,9 +205,9 @@ fn check_test_attrs(path: &Path, text: &str) { } if let Some((line, _)) = text .lines() - .tuple_windows() + .array_windows::<2>() .enumerate() - .find(|(_, (a, b))| b.contains("#[should_panic") && !a.contains("FIXME")) + .find(|(_, [a, b])| b.contains("#[should_panic") && !a.contains("FIXME")) { panic!( "\ndon't add `#[should_panic]` tests, see:\n\n {}\n\n {}:{line}\n", |