]> git.lizzy.rs Git - rust.git/blobdiff - src/liballoc/vec.rs
Apply suggestion from review
[rust.git] / src / liballoc / vec.rs
index c2cf64393adf8db1a1b62438629a9eac8521a920..2f56898f4e9b66e43823aa765140932a0e082028 100644 (file)
@@ -491,7 +491,7 @@ pub fn capacity(&self) -> usize {
     ///
     /// # Panics
     ///
-    /// Panics if the new capacity overflows `usize`.
+    /// Panics if the new capacity exceeds `isize::MAX` bytes.
     ///
     /// # Examples
     ///
@@ -1188,7 +1188,7 @@ pub fn dedup_by<F>(&mut self, same_bucket: F)
     ///
     /// # Panics
     ///
-    /// Panics if the number of elements in the vector overflows a `usize`.
+    /// Panics if the new capacity exceeds `isize::MAX` bytes.
     ///
     /// # Examples
     ///
@@ -1274,11 +1274,10 @@ unsafe fn append_elements(&mut self, other: *const [T]) {
     /// Creates a draining iterator that removes the specified range in the vector
     /// and yields the removed items.
     ///
-    /// Note 1: The element range is removed even if the iterator is only
-    /// partially consumed or not consumed at all.
-    ///
-    /// Note 2: It is unspecified how many elements are removed from the vector
-    /// 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.
     ///
     /// # Panics
     ///