]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rust: rbtree: fix documentation typo in CursorMut peek_next method
authorHang Shu <m18080292938@163.com>
Fri, 7 Nov 2025 09:39:17 +0000 (09:39 +0000)
committerMiguel Ojeda <ojeda@kernel.org>
Sun, 4 Jan 2026 22:51:35 +0000 (23:51 +0100)
The peek_next method's doc comment incorrectly stated it accesses the
"previous" node when it actually accesses the next node.

Fix the documentation to accurately reflect the method's behavior.

Fixes: 98c14e40e07a ("rust: rbtree: add cursor")
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Hang Shu <m18080292938@163.com>
Reported-by: Miguel Ojeda <ojeda@kernel.org>
Closes: https://github.com/Rust-for-Linux/linux/issues/1205
Cc: stable@vger.kernel.org
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20251107093921.3379954-1-m18080292938@163.com
[ Reworded slightly. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/rbtree.rs

index 6c3dbb2e6f0d34330bf7691bf9ebae792218d6da..312cecab72e780421a996ff176d248f63cad9779 100644 (file)
@@ -985,7 +985,7 @@ impl<'a, K, V> CursorMut<'a, K, V> {
         self.peek(Direction::Prev)
     }
 
-    /// Access the previous node without moving the cursor.
+    /// Access the next node without moving the cursor.
     pub fn peek_next(&self) -> Option<(&K, &V)> {
         self.peek(Direction::Next)
     }