We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c4e1734 + 654c180 commit 0e11fc8Copy full SHA for 0e11fc8
src/liballoc/vec.rs
@@ -1274,11 +1274,10 @@ impl<T> Vec<T> {
1274
/// Creates a draining iterator that removes the specified range in the vector
1275
/// and yields the removed items.
1276
///
1277
- /// Note 1: The element range is removed even if the iterator is only
1278
- /// partially consumed or not consumed at all.
1279
- ///
1280
- /// Note 2: It is unspecified how many elements are removed from the vector
1281
- /// if the `Drain` value is leaked.
+ /// When the iterator **is** dropped, all elements in the range are removed
+ /// from the vector, even if the iterator was not fully consumed. If the
+ /// iterator **is not** dropped (with [`mem::forget`] for example), it is
+ /// unspecified how many elements are removed.
1282
1283
/// # Panics
1284
0 commit comments