Re: [PATCH v4 06/11] rust: xarray: add `find_next` and `find_next_mut`

From: Andreas Hindborg

Date: Thu Aug 27 2026 - 05:59:16 EST


Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx> writes:

> Hi Andreas,
>
> I wonder if we can't hoist most of these calls accessing self.state.state to
> the XArrayState directly? For example, I see this in a couple of places:
>
> + bindings::xas_result(
> + &mut self.state.state,
> + bindings::xa_zero_to_null(bindings::xas_store(
> + &mut self.state.state,
> + core::ptr::null_mut(),
> + )),
> + )
>
>
> How about XArrayState::replace(new: *mut c_void) -> *mut c_void?
>
> Also:
>
> + state.state.xa_node = bindings::XAS_RESTART as *mut bindings::xa_node;
> + state.state.xa_index = 0;
>
> Could be e.g.: "restart_at(index)”.
>
>
> WDYT?

I think that is a good suggestion, I will do that.

Best regards,
Andreas Hindborg