|
|
|
|
|
by magicalhippo
1793 days ago
|
|
> If that "device::Data::new()" is equivalent to the many lines of init in the C version, it looks less footguny. The Rust version is probably more robust, I would hope and assume so. However it looks considerably more complex, I think even if I knew Rust I'd have a harder time parsing it and trying to figure out what it tries to do, compared to the C version. So maybe we could say the Rust version is harder to parse but easier to reason about once parsed. > How are you sure that "gpiochip_get_data(irq_data_get_irq_chip_data(...))" never fails and can be safely dereferrenced ? Fair point, it should have a check there. Which makes this comparison a bit harder, given that the code is so different. |
|
I feel this is a matter of familiarity. For me the Rust version is easier to parse and reason about. Entirely because of familiarity.