Skip to content

Commit 3d85f73

Browse files
authored
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.
1 parent aedebfe commit 3d85f73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcollections/vec.rs

+2-2
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)