Skip to content

Commit 8c56299

Browse files
authored
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.
2 parents 48a0d03 + 30c61ee commit 8c56299

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/core/src/slice/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,8 @@ impl<T> [T] {
851851

852852
/// Swaps two elements in the slice.
853853
///
854+
/// If `a` equals to `b`, it's guaranteed that elements won't change value.
855+
///
854856
/// # Arguments
855857
///
856858
/// * a - The index of the first element

0 commit comments

Comments
 (0)