[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250521152705.1056252-1-ojeda@kernel.org>
Date: Wed, 21 May 2025 17:27:05 +0200
From: Miguel Ojeda <ojeda@...nel.org>
To: richard120310@...il.com
Cc: a.hindborg@...nel.org,
alex.gaynor@...il.com,
aliceryhl@...gle.com,
benno.lossin@...ton.me,
bjorn3_gh@...tonmail.com,
boqun.feng@...il.com,
dakr@...nel.org,
gary@...yguo.net,
jserv@...s.ncku.edu.tw,
linux-kernel-mentees@...ts.linux.dev,
linux-kernel@...r.kernel.org,
ojeda@...nel.org,
rust-for-linux@...r.kernel.org,
skhan@...uxfoundation.org,
tmgross@...ch.edu
Subject: Re: [RFC PATCH v2] rust: list: Add examples for linked list
On Tue, 11 Mar 2025 21:33:57 +0800 I Hsin Cheng <richard120310@...il.com> wrote:
>
> Add basic examples for the structure "List", also serve as the unit
> tests for basic list methods. Including the following manipulations:
> * List creation
> * List emptiness check
> * List insertion through push_front(), push_back()
> * List item removal through pop_front(), pop_back()
> * Push one list to another through push_all_back()
>
> The method "remove()" doesn't have an example here because insertion
> with push_front() or push_back() will take the ownership of the item,
> which means we can't keep any valid reference to the node we want to
> remove, unless Cursor is used. The remove example through Cursor is
> already demonstrate with 'commit 52ae96f5187c ("rust: list: make the
> cursor point between elements")' .
>
> Link: https://github.com/Rust-for-Linux/linux/issues/1121
> Signed-off-by: I Hsin Cheng <richard120310@...il.com>
It would be nice to pick this one up, even if it is similar to the
cursor one -- some methods shown here are not in the other example.
Any reviews Reviewed-bys/Tested-bys, anyone? (I can clean a few nits on
my side when applying).
By the way, similarly to the other one, your email did not reach my
inbox for some reason.
Thanks!
Cheers,
Miguel
Powered by blists - more mailing lists