gtk-rs / gir

Tool to generate rust bindings and user API for glib-based libraries
https://gtk-rs.org/gir/book/
MIT License
232 stars 105 forks source link

config/codegen: Stop generating useless Display impls #1502

Closed bilelmoussaoui closed 1 year ago

bilelmoussaoui commented 1 year ago

So just get rid of that generated code and let the bindings generate a display impl manually when it makes sense

bilelmoussaoui commented 1 year ago

Note that the special display implementations are kept, if the type has a to_string / name or similarly named methods. I won't touch these

sdroege commented 1 year ago

Yes keeping those is a good idea.

pbor commented 1 year ago

could it be worth to have a display_method = ... in Gir.toml instead of manually overriding? Eg for GFile it would point to parse_name

(This can also be a follow up)

bilelmoussaoui commented 1 year ago

Sure, not going to do that though :) it shouldn't be too difficult to add a new config that make the configured function name used in the display impl

bilelmoussaoui commented 1 year ago

should be good to go :)