The array docs currently say
|
/// There is no way to move elements out of an array. See [`mem::replace`][replace] |
|
/// for an alternative. |
But now that slice patterns are stable, that's not quite true. It would be good for the docs to mention that you can move all items out of an array using a slice pattern. (And continue to mention replace as an option for people who only want one item.)
The array docs currently say
rust/src/libstd/primitive_docs.rs
Lines 485 to 486 in 6312b89
But now that slice patterns are stable, that's not quite true. It would be good for the docs to mention that you can move all items out of an array using a slice pattern. (And continue to mention
replaceas an option for people who only want one item.)