Re: [PATCH v4] rust: pci: reject IRQ vector indices that do not fit in u32
From: Danilo Krummrich
Date: Tue Sep 01 2026 - 07:57:47 EST
On Tue Sep 1, 2026 at 12:58 PM CEST, Alexandre Courbot wrote:
> That makes me wonder, shouldn't we make `index` take a `u32` directly?
> If that's what the C API expects, it does make sense to align to it
> instead of forcing users to make a potential unneeded conversion if they
> already have a u32.
I intentionally did not do this, as the common type for an index is usize. Thus,
I do not expect anyone to already have a u32, but to already have a usize, e.g.
from some iterator.
The fact that the C API did pick unsigned int as index type is an implementation
detail the abstraction should bother with.