]> git.lizzy.rs Git - rust.git/blobdiff - library/alloc/src/vec/mod.rs
Rollup merge of #92077 - jyn514:remove-collapsed, r=GuillaumeGomez
[rust.git] / library / alloc / src / vec / mod.rs
index d24b4bdffdefcd61d8e94284eb2ae5ef9a032806..7185f3de18ade3b6ed9f7f4be7c159d0e6822e91 100644 (file)
@@ -2683,11 +2683,11 @@ fn extend_desugared<I: Iterator<Item = T>>(&mut self, mut iterator: I) {
     /// # Examples
     ///
     /// ```
-    /// let mut v = vec![1, 2, 3];
-    /// let new = [7, 8];
-    /// let u: Vec<_> = v.splice(..2, new).collect();
-    /// assert_eq!(v, &[7, 8, 3]);
-    /// assert_eq!(u, &[1, 2]);
+    /// let mut v = vec![1, 2, 3, 4];
+    /// let new = [7, 8, 9];
+    /// let u: Vec<_> = v.splice(1..3, new).collect();
+    /// assert_eq!(v, &[1, 7, 8, 9, 4]);
+    /// assert_eq!(u, &[2, 3]);
     /// ```
     #[cfg(not(no_global_oom_handling))]
     #[inline]