diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-05-23 07:43:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-23 07:43:49 +0200 |
| commit | e5cf3cb97d228f7c5ac691ebf3f754bec5a92852 (patch) | |
| tree | 8c634cf1808bd1d68298fa82e72eaca89445a69e /library/core/src/slice | |
| parent | c186f7c07912064c352f12d8b0aa9d5e5975450e (diff) | |
| parent | 4a2214885d469b27624df33145863037ca148f56 (diff) | |
Rollup merge of #97087 - Nilstrieb:clarify-slice-iteration-order, r=dtolnay
Clarify slice and Vec iteration order While already being inferable from the doc examples, it wasn't fully specified. This is the only logical way to do a slice iterator, so I think this should be uncontroversial. It also improves the `Vec::into_iter` example to better show the order and that the iterator returns owned values.
Diffstat (limited to 'library/core/src/slice')
| -rw-r--r-- | library/core/src/slice/mod.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 7ac7573b43c..f5a90cb3d7a 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -716,6 +716,8 @@ impl<T> [T] { /// Returns an iterator over the slice. /// + /// The iterator yields all items from start to end. + /// /// # Examples /// /// ``` @@ -735,6 +737,8 @@ impl<T> [T] { /// Returns an iterator that allows modifying each value. /// + /// The iterator yields all items from start to end. + /// /// # Examples /// /// ``` |
