lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72=f94m5mG69+wvh-x7xX_-sbRuq1OzMfOtkNJhwWstqcg@mail.gmail.com>
Date: Fri, 13 Dec 2024 20:37:56 +0100
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Tamir Duberstein <tamird@...il.com>
Cc: Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>, 
	Danilo Krummrich <dakr@...nel.org>, Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>, 
	Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>, 
	Björn Roy Baron <bjorn3_gh@...tonmail.com>, 
	Benno Lossin <benno.lossin@...ton.me>, Trevor Gross <tmgross@...ch.edu>, 
	Maíra Canal <mcanal@...lia.com>, 
	Asahi Lina <lina@...hilina.net>, rust-for-linux@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v12 2/2] rust: xarray: Add an abstraction for XArray

On Fri, Dec 13, 2024 at 6:55 PM Tamir Duberstein <tamird@...il.com> wrote:
>
> Implicit in this statement is the assumption that while new to Rust,
> those reviewers will not be new to C.

Sorry, I am not sure what you mean.

I was talking about maintainers and key reviewers that need to read
your code, and thus the "advantageous for the submitter" bit, who most
likely are able to read C.

But even if you are talking about a reviewer that is new to C (or even
both C and Rust), they will be able to understand your Rust code if
you are writing an `if` instead of `.then()`.

It is not about what style is best, but about making it readable for
the majority of readers.

> Anyway, I'm not emotionally attached to this style. Would you prefer I
> rewrite it using loops and conditionals? Whatever helps this land, I
> will do.

Personally, I would rewrite at least the `if` one, since it is not
really how we write those elsewhere. The other one, since you are
building an iterator anyway, I think it makes sense. For similar
reasons, perhaps one `match` you have could be an early return
instead.

But it is up to the maintainer. By the way, I don't see the XARRAY
maintainer nor the list Cc'd?

Thanks!

Cheers,
Miguel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ