From 449007f2dc139a7d3a5e209e1d5003a70ce9e294 Mon Sep 17 00:00:00 2001 From: lucasallison Date: Tue, 7 Nov 2023 12:49:05 +0100 Subject: [PATCH] Changed the `assert_within_bounds` in the `extend_from_within` function to allow ranges that include the last element of the vector. --- src/vec/api.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vec/api.rs b/src/vec/api.rs index 09d2d65d..a962b0f7 100644 --- a/src/vec/api.rs +++ b/src/vec/api.rs @@ -965,7 +965,7 @@ where where R: RangeExt { let old_len = self.len(); let src = src.normalize(0, old_len); - self.assert_in_bounds(src.end, 0 .. old_len); + self.assert_in_bounds(src.end, 0 ..=old_len); self.resize(old_len + src.len(), false); unsafe { self.copy_within_unchecked(src, old_len);