Hi Alex,
Nice improvement, a nit:
On Wed, Oct 29, 2025 at 12:07:37AM +0900, Alexandre Courbot wrote:
[..]
> impl PmuLookupTable {
> fn new(dev: &device::Device, data: &[u8]) -> Result<Self> {
> - if data.len() < 4 {
> - return Err(EINVAL);
> - }
> + let header = PmuLookupTableHeader::from_bytes_copy_prefix(data)
> + .ok_or(EINVAL)?
> + .0;
Can we change to the following, it is easier to read than using `.0` IMO.
let (header, _rest) = PmuLookupTableHeader::from_bytes_copy_prefix(data)
.ok_or(EINVAL)?;
(and similarly in the other patches).
thanks,
- Joel