rust/library/alloc
Matthias Krüger 690d6b0958
Rollup merge of #92071 - ajtribick:patch-1, r=the8472
Update example code for Vec::splice to change the length

The current example for `Vec::splice` illustrates the replacement of a section of length 2 with a new section of length 2. This isn't a particularly interesting case for splice, and makes it look a bit like a shorthand for the kind of manipulations that could be done with a mutable slice.

In order to provide a stronger example, this updates the example to use different lengths for the source and destination regions, and uses a slice from the middle of the vector to illustrate that this does not necessarily have to be at the beginning or the end.

Resolves #92067
2021-12-19 10:45:54 +01:00
..
benches update vec::retain benchmarks 2021-12-04 16:20:35 +01:00
src Rollup merge of #92071 - ajtribick:patch-1, r=the8472 2021-12-19 10:45:54 +01:00
tests Rollup merge of #91916 - steffahn:fix-typos, r=dtolnay 2021-12-15 10:57:02 +01:00
Cargo.toml rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00