Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#135381 - cod10129:vec-splice-doc, r=tgross35 Add an example for `Vec::splice` inserting elements without removing This example clearly showcases how `splice` can be used to insert multiple elements efficiently at an index into a vector. Fixes rust-lang#135369. The added example: > Using `splice` to insert new items into a vector efficiently at a specific position indicated by an empty range: > ```rust > let mut v = vec![1, 5]; > let new = [2, 3, 4]; > v.splice(1..1, new); > assert_eq!(v, [1, 2, 3, 4, 5]); > ``` `@rustbot` label A-docs A-collections
- Loading branch information