Re: [PATCH 4/4] rust: xarray: Add Guard::find() helper

From: Matthew Wilcox

Date: Thu Apr 16 2026 - 21:18:35 EST


On Fri, Apr 17, 2026 at 09:05:54AM +0800, Alvin Sun wrote:
> Add a helper to find the first present entry in the XArray.

Why would you expose a function which does striclty less than the
underlying C implementation, rather than exposing all the functionality
that xa_find does?

> Returns the index of the first present entry, or None if the array
> is empty.

Why not return the value found, like xa_find() does?

This is all very troubling. I don't think Rust should depart from
what C has without good reason.