Skip to content

Commit 654c180

Browse files
committed
Apply suggestion from review
1 parent 771ec21 commit 654c180

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/liballoc/vec.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -1274,12 +1274,10 @@ impl<T> Vec<T> {
12741274
/// Creates a draining iterator that removes the specified range in the vector
12751275
/// and yields the removed items.
12761276
///
1277-
/// The element range is removed even if the iterator is only partially
1278-
/// consumed or not consumed at all.
1279-
///
1280-
/// Note: Be aware that if the iterator is leaked (eg: [`mem::forget`]), it
1281-
/// cancels this property so it is unspecified how many elements are removed
1282-
/// from the vector in this case.
1277+
/// When the iterator **is** dropped, all elements in the range are removed
1278+
/// from the vector, even if the iterator was not fully consumed. If the
1279+
/// iterator **is not** dropped (with [`mem::forget`] for example), it is
1280+
/// unspecified how many elements are removed.
12831281
///
12841282
/// # Panics
12851283
///

0 commit comments

Comments
 (0)