* [PATCH] rust: correct documentation comment for rbtree cursor peek_next method
@ 2025-11-06 11:20 Hang Shu
2025-11-06 11:32 ` Alice Ryhl
0 siblings, 1 reply; 4+ messages in thread
From: Hang Shu @ 2025-11-06 11:20 UTC (permalink / raw)
To: ojeda
Cc: Hang Shu, Alex Gaynor, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Danilo Krummrich, Hang Shu, rust-for-linux, linux-kernel
From: Hang Shu <hangshu847@gmail.com>
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.
Signed-off-by: Hang Shu <hangshu847@gmail.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 b8fe6be6f..9e178dacd 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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] rust: correct documentation comment for rbtree cursor peek_next method
2025-11-06 11:20 [PATCH] rust: correct documentation comment for rbtree cursor peek_next method Hang Shu
@ 2025-11-06 11:32 ` Alice Ryhl
0 siblings, 0 replies; 4+ messages in thread
From: Alice Ryhl @ 2025-11-06 11:32 UTC (permalink / raw)
To: Hang Shu
Cc: ojeda, Hang Shu, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Danilo Krummrich, rust-for-linux, linux-kernel
On Thu, Nov 06, 2025 at 11:20:14AM +0000, Hang Shu wrote:
> From: Hang Shu <hangshu847@gmail.com>
>
> 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.
>
> Signed-off-by: Hang Shu <hangshu847@gmail.com>
Thanks.
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
This should probably have a fixes tag:
Fixes: 98c14e40e07a ("rust: rbtree: add cursor")
Alice
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] rust: correct documentation comment for rbtree cursor peek_next method
@ 2025-11-07 2:47 Hang Shu
2025-11-07 9:17 ` Alice Ryhl
0 siblings, 1 reply; 4+ messages in thread
From: Hang Shu @ 2025-11-07 2:47 UTC (permalink / raw)
To: ojeda
Cc: Hang Shu, Alex Gaynor, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Danilo Krummrich, Yutaro Ohno, Onur Özkan, Borys Tyran,
Charalampos Mitrodimas, Daniel Sedlak, Tamir Duberstein,
Matt Gilbride, rust-for-linux, linux-kernel
From: Hang Shu <hangshu847@gmail.com>
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")
Signed-off-by: Hang Shu <hangshu847@gmail.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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] rust: correct documentation comment for rbtree cursor peek_next method
2025-11-07 2:47 Hang Shu
@ 2025-11-07 9:17 ` Alice Ryhl
0 siblings, 0 replies; 4+ messages in thread
From: Alice Ryhl @ 2025-11-07 9:17 UTC (permalink / raw)
To: Hang Shu
Cc: ojeda, Hang Shu, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Danilo Krummrich, Yutaro Ohno, Onur Özkan,
Borys Tyran, Charalampos Mitrodimas, Daniel Sedlak,
Tamir Duberstein, Matt Gilbride, rust-for-linux, linux-kernel
On Fri, Nov 07, 2025 at 02:47:16AM +0000, Hang Shu wrote:
> From: Hang Shu <hangshu847@gmail.com>
>
> 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")
> Signed-off-by: Hang Shu <hangshu847@gmail.com>
I shared a Reviewed-by tag for the first version, so please include it
in the commit message when sending a new version. That way, I don't have
to review the same code twice.
Also, this should say [PATCH v2] in the subject since it's version 2 of
this patch.
Alice
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-11-07 9:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-06 11:20 [PATCH] rust: correct documentation comment for rbtree cursor peek_next method Hang Shu
2025-11-06 11:32 ` Alice Ryhl
-- strict thread matches above, loose matches on Subject: below --
2025-11-07 2:47 Hang Shu
2025-11-07 9:17 ` Alice Ryhl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).