Skip to content

Commit 905ce57

Browse files
authored
cut down counterexample prose and adjust punctuation
1 parent 15b74f9 commit 905ce57

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

library/core/src/slice/mod.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,12 +1099,11 @@ impl<T> [T] {
10991099
/// assert!(iter.next().is_none());
11001100
/// ```
11011101
///
1102-
/// Because the [Iterator] trait cannot represent the required lifetimes, there is no `windows_mut` analog to `windows`.
1103-
/// (If there was, then `[0,1,2].windows_mut(2).collect()` would create 2 mutable references
1104-
/// to the middle element of that array, which would violate [the rules of references],
1105-
/// though a [LendingIterator] analog is possible.)
1106-
/// However, you can sometimes use [`Cell::as_slice_of_cells`](crate::cell::Cell::as_slice_of_cells) in
1107-
/// conjunction with `windows` to accomplish something similar:
1102+
/// Because the [Iterator] trait cannot represent the required lifetimes, there is no `windows_mut` analog to `windows`;
1103+
/// `[0,1,2].windows_mut(2).collect()` would violate [the rules of references]
1104+
/// (though a [LendingIterator] analog is possible).
1105+
/// You can sometimes use [`Cell::as_slice_of_cells`](crate::cell::Cell::as_slice_of_cells) in
1106+
/// conjunction with `windows` instead:
11081107
///
11091108
/// [the rules of references]: https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#the-rules-of-references
11101109
/// [LendingIterator]: https://blog.rust-lang.org/2022/10/28/gats-stabilization.html

0 commit comments

Comments
 (0)