Skip to content

Commit a7ac69a

Browse files
committed
Rollup merge of rust-lang#39135 - TheCycoONE:vec_drain_doc, r=alexcrichton
Clarify when range is removed by drain Based on a discussion on #rust-beginners the existing note for drain is confusing. This new wording was suggested.
2 parents 1054171 + 3d85f73 commit a7ac69a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcollections/vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,8 +1023,8 @@ impl<T> Vec<T> {
10231023
/// Create a draining iterator that removes the specified range in the vector
10241024
/// and yields the removed items.
10251025
///
1026-
/// Note 1: The element range is removed even if the iterator is not
1027-
/// consumed until the end.
1026+
/// Note 1: The element range is removed even if the iterator is only
1027+
/// partially consumed or not consumed at all.
10281028
///
10291029
/// Note 2: It is unspecified how many elements are removed from the vector,
10301030
/// if the `Drain` value is leaked.

0 commit comments

Comments
 (0)