std: edit [T]::swap docs

Add a note telling that no elements change when arguments are equal
This commit is contained in:
João M. Bezerra 2023-06-26 13:33:53 -03:00
parent 27e10c5292
commit 30c61eece4

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