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:
Matthias Krüger
2023-07-08 20:53:27 +02:00
committed by GitHub
+2
View File
@@ -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