]> git.lizzy.rs Git - rust.git/commitdiff
Clarify when range is removed by drain
authorStephen E. Baker <baker.stephen.e@gmail.com>
Tue, 17 Jan 2017 19:39:16 +0000 (14:39 -0500)
committerGitHub <noreply@github.com>
Tue, 17 Jan 2017 19:39:16 +0000 (14:39 -0500)
Based on a discussion on #rust-beginners the existing note for drain is confusing. This new wording was suggested.

src/libcollections/vec.rs

index 4b05f8062e8bc22a60930a6472ea01840cbb7034..c5b904c8a2f0e3fac57ce8afb220ea04700a3910 100644 (file)
@@ -1023,8 +1023,8 @@ pub fn append(&mut self, other: &mut Self) {
     /// Create 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 not
-    /// consumed until the end.
+    /// 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.