Open ThePerfectComputer opened 3 months ago
I'm not necessarily against Macros, but this crosses the line IMO. Things are now too hard to trace down for somebody reading/perusing the codebase.
If I'm not wrong while looking at the code on my phone - the method called on that line is generated from the WIT component description by official Rust WIT component tools. The suggested changes would make it much less maintainable because it would ignore best WIT practices and it would break in case of WIT API changes because the macros make it verifiable by Rust compiler. However we can help the reader of the code by changing the component description itself to make the generated code more expressive or at least add some comments or other hints for the reader.
This is understandable. Let me chew on this some more...
This line seems to be enabled by
bindgen!()
magic... Such makes the codebase less readable. Can you re-factor this to get rid ofbindgen!()
magic, perhaps opting for something a bit more readable/maintainable such aslet format_signal_value = instance.get_func(&mut store, "format_signal_value").unwrap().get1::<i32, i32>()?;
?