mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 00:03:43 +00:00
Rollup merge of #113064 - marcospb19:add-note-in-vec-swap-docs, r=Mark-Simulacrum
std: edit [T]::swap docs Add a note about what happens when index arguments are equal.
This commit is contained in:
commit
8c562996dd
@ -851,6 +851,8 @@ impl<T> [T] {
|
||||
|
||||
/// Swaps two elements in the slice.
|
||||
///
|
||||
/// If `a` equals to `b`, it's guaranteed that elements won't change value.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * a - The index of the first element
|
||||
|
Loading…
Reference in New Issue
Block a user