rust-bindgen
rust-bindgen copied to clipboard
Is it always necessary to put every function definition in a separate extern block?
Here is a diff of regenerating some bindings with servo/rust-bindgen over the old Yamakaky/rust-bindgen: https://github.com/jeremyletang/rust-sfml/commit/ed4ecd7d48d756bf2d51d85f928c3c736c780625#diff-1e7d161ae38b44ab3fb4c32f7c2bdf19R371
It adds a lot of extra noise with all those extern blocks.
So this is done this way because after the rewrite, each parsed item is conceptually independent and can generate a rust ast::Item
. The way to do this for functions is generating an extern block.
I don't think coalescing them is a priority, but I'd be happy to take a patch that does it as long as it's not a maintenance burden.
This should IMO be a top priority to fix.
I've read lots of reports from users on IRC and that was their main complaint about it.
This should IMO be a top priority to fix.
Its purely aesthetics of machine generated code that people aren't maintaining by hand... That doesn't scream "top priority" to me, but patches are ofc very welcome.
Its purely aesthetics of machine generated code that people aren't maintaining by hand...
Aesthetics matter, and changes to generated bindings are more confusing to review with all the noise.