about summary refs log tree commit diff
path: root/library/core/src
diff options
context:
space:
mode:
authorJoão M. Bezerra <marcospb19@hotmail.com>2023-06-26 13:33:53 -0300
committerJoão M. Bezerra <marcospb19@hotmail.com>2023-06-27 18:12:02 -0300
commit30c61eece4ce212e8b0b6c384b3abc9d24201d26 (patch)
tree63a85796584c343602aabdaac2f0cbd38091c975 /library/core/src
parent27e10c5292eee22abef69aed7144f80bdea00603 (diff)
downloadrust-30c61eece4ce212e8b0b6c384b3abc9d24201d26.tar.gz
rust-30c61eece4ce212e8b0b6c384b3abc9d24201d26.zip
std: edit [T]::swap docs
Add a note telling that no elements change when arguments are equal
Diffstat (limited to 'library/core/src')
-rw-r--r--library/core/src/slice/mod.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs
index 5d6e7dcfcee..e2a2428fbc2 100644
--- a/library/core/src/slice/mod.rs
+++ b/library/core/src/slice/mod.rs
@@ -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