Skip to content

Commit

Permalink
Rollup merge of rust-lang#113064 - marcospb19:add-note-in-vec-swap-do…
Browse files Browse the repository at this point in the history
…cs, r=Mark-Simulacrum

std: edit [T]::swap docs

Add a note about what happens when index arguments are equal.
  • Loading branch information
matthiaskrgr authored Jul 8, 2023
2 parents 6e20345 + 30c61ee commit f98b417
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f98b417

Please sign in to comment.