diff options
| author | Alexis Bourget <alexis.bourget@gmail.com> | 2020-07-24 19:55:08 +0200 |
|---|---|---|
| committer | Alexis Bourget <alexis.bourget@gmail.com> | 2020-07-24 19:55:08 +0200 |
| commit | 654c180d05fedc8a9a3c793cfc747ad542d3a4f2 (patch) | |
| tree | 74b428e85552200675a60bbd603b96caac8c674b /src/liballoc | |
| parent | 771ec216bc87932e341cf1f4d887988228d429b5 (diff) | |
| download | rust-654c180d05fedc8a9a3c793cfc747ad542d3a4f2.tar.gz rust-654c180d05fedc8a9a3c793cfc747ad542d3a4f2.zip | |
Apply suggestion from review
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/vec.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 30ff28f3fdb..2f56898f4e9 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -1274,12 +1274,10 @@ impl<T> Vec<T> { /// Creates a draining iterator that removes the specified range in the vector /// and yields the removed items. /// - /// The element range is removed even if the iterator is only partially - /// consumed or not consumed at all. - /// - /// Note: Be aware that if the iterator is leaked (eg: [`mem::forget`]), it - /// cancels this property so it is unspecified how many elements are removed - /// from the vector in this case. + /// 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. /// /// # Panics /// |
