about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-09-16 23:20:43 +0200
committerGitHub <noreply@github.com>2023-09-16 23:20:43 +0200
commite2ea3475170f1ef8490e9864af99db0d2d9bf633 (patch)
tree87d75b388acf6f18d6f4b7f4f724a7a082ebb569 /library/alloc/src
parent5a8179bf5a018f2ea90e52ffc1e37cf88df9606f (diff)
parent1c7a77a638c523499252feaec986ee99c5d0baf5 (diff)
downloadrust-e2ea3475170f1ef8490e9864af99db0d2d9bf633.tar.gz
rust-e2ea3475170f1ef8490e9864af99db0d2d9bf633.zip
Rollup merge of #115895 - 52:patch-docs-vec-truncate, r=dtolnay
Improve Vec(Deque)::truncate documentation

Fixes #115784
Diffstat (limited to 'library/alloc/src')
-rw-r--r--library/alloc/src/collections/vec_deque/mod.rs4
-rw-r--r--library/alloc/src/vec/mod.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/library/alloc/src/collections/vec_deque/mod.rs b/library/alloc/src/collections/vec_deque/mod.rs
index 5965ec2affa..4ef8af9b034 100644
--- a/library/alloc/src/collections/vec_deque/mod.rs
+++ b/library/alloc/src/collections/vec_deque/mod.rs
@@ -1015,8 +1015,8 @@ impl<T, A: Allocator> VecDeque<T, A> {
     /// Shortens the deque, keeping the first `len` elements and dropping
     /// the rest.
     ///
-    /// If `len` is greater than the deque's current length, this has no
-    /// effect.
+    /// If `len` is greater or equal to the deque's current length, this has
+    /// no effect.
     ///
     /// # Examples
     ///
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index 4cfffdf18c6..02331db3341 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -1110,8 +1110,8 @@ impl<T, A: Allocator> Vec<T, A> {
     /// Shortens the vector, keeping the first `len` elements and dropping
     /// the rest.
     ///
-    /// If `len` is greater than the vector's current length, this has no
-    /// effect.
+    /// If `len` is greater or equal to the vector's current length, this has
+    /// no effect.
     ///
     /// The [`drain`] method can emulate `truncate`, but causes the excess
     /// elements to be returned instead of dropped.