about summary refs log tree commit diff
path: root/library/alloc/src/vec
diff options
context:
space:
mode:
authordylni <46035563+dylni@users.noreply.github.com>2021-01-17 23:12:29 -0500
committerdylni <46035563+dylni@users.noreply.github.com>2021-02-12 22:01:04 -0500
commit9d29793614cc810fb8febf7f1a2e0202f3919bb6 (patch)
treebf124824063aead8e27099ec4144deb5facfa88e /library/alloc/src/vec
parent3f5aee2d5241139d808f4fdece0026603489afd1 (diff)
downloadrust-9d29793614cc810fb8febf7f1a2e0202f3919bb6.tar.gz
rust-9d29793614cc810fb8febf7f1a2e0202f3919bb6.zip
Improve design of `assert_len`
Diffstat (limited to 'library/alloc/src/vec')
-rw-r--r--library/alloc/src/vec/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index b40c1a8c57a..5c20f382224 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -1650,7 +1650,7 @@ impl<T, A: Allocator> Vec<T, A> {
         // the hole, and the vector length is restored to the new length.
         //
         let len = self.len();
-        let Range { start, end } = range.assert_len(len);
+        let Range { start, end } = range.ensure_subset_of(..len);
 
         unsafe {
             // set self.vec length's to start, to be safe in case Drain is leaked