mirror of
https://github.com/openharmony/third_party_rust_rust.git
synced 2026-07-19 19:53:38 -04: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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user