[PATCH v2] rust: correct documentation comment for rbtree cursor peek_next method

Hang Shu posted 1 patch 3 months ago
rust/kernel/rbtree.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v2] rust: correct documentation comment for rbtree cursor peek_next method
Posted by Hang Shu 3 months ago
The peek_next method's doc comment incorrectly stated it accesses the
"previous" node when it actually accesses the next node. This commit
fixes 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>
---
 rust/kernel/rbtree.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/kernel/rbtree.rs b/rust/kernel/rbtree.rs
index b8fe6be6fcc4..9e178dacddf1 100644
--- a/rust/kernel/rbtree.rs
+++ b/rust/kernel/rbtree.rs
@@ -835,7 +835,7 @@ pub fn peek_prev(&self) -> Option<(&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)
     }
-- 
2.43.0
Re: [PATCH v2] rust: correct documentation comment for rbtree cursor peek_next method
Posted by Miguel Ojeda 1 month ago
On Fri, Nov 7, 2025 at 10:40 AM Hang Shu <m18080292938@163.com> wrote:
>
> The peek_next method's doc comment incorrectly stated it accesses the
> "previous" node when it actually accesses the next node. This commit
> fixes 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>

Applied to `rust-fixes` -- thanks everyone!

    [ Reworded slightly. - Miguel ]

I merged the tags from:

    https://lore.kernel.org/rust-for-linux/JH0PR01MB55140AA42EB3AAF96EF7F3E8ECAEA@JH0PR01MB5514.apcprd01.prod.exchangelabs.com/

Cheers,
Miguel