Remove Bindgen Magic to Enhance Readability #15
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Products/FastWave2.0#15
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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>()?;
?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...