Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config/codegen: Stop generating useless Display impls #1502

Merged
merged 4 commits into from
Aug 24, 2023

Conversation

bilelmoussaoui
Copy link
Member

  • objects: It uses to print the type name: not useful at all
  • enums: It does print what a debug impl would print
  • flags: It does print what a debug impl would print

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

- objects: It uses to print the type name: not useful at all
- enums: It does print what a debug impl would print
- flags: It does print what a debug impl would print

So just get rid of that generated code and let the bindings generate a display
impl manually when it makes sense
@bilelmoussaoui
Copy link
Member Author

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
Copy link
Member

sdroege commented Aug 16, 2023

Yes keeping those is a good idea.

@pbor
Copy link
Contributor

pbor commented Aug 16, 2023

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
Copy link
Member Author

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 bilelmoussaoui force-pushed the bilelmoussaoui/no-more-display branch 3 times, most recently from 8fe7aa3 to ff23a44 Compare August 16, 2023 09:50
@bilelmoussaoui
Copy link
Member Author

should be good to go :)

@bilelmoussaoui bilelmoussaoui merged commit 33ab47b into master Aug 24, 2023
6 checks passed
@bilelmoussaoui bilelmoussaoui deleted the bilelmoussaoui/no-more-display branch August 24, 2023 20:03
@arcnmx arcnmx mentioned this pull request May 24, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants