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

Refactor config-building in lib.rs's run_with_repo #146

Closed
blairconrad opened this issue Feb 4, 2025 · 2 comments · Fixed by #147
Closed

Refactor config-building in lib.rs's run_with_repo #146

blairconrad opened this issue Feb 4, 2025 · 2 comments · Fixed by #147

Comments

@blairconrad
Copy link
Contributor

From #143 (comment):

I have a weak dislike for [the recent config refactoring in #143 …] refactors are a matter of taste after all. if i was going to spend time cleaning it up, i would probably make a function in config.rs that takes a Config and returns a new Config with flags unified and repo defaults applied (then run_with_repo can go back to taking an immutable Config). maybe dedup the config fetching code too, but that might require a macro.

@blairconrad
Copy link
Contributor Author

@tummychow, so far I have only read the word "macro" as pertains to rust, but if you're not in a huge rush, I'd like to try to fix this. I caused (or at least contributed to) the problem after all.

@tummychow
Copy link
Owner

i'm not too committed to the idea of using a macro for this, only if it leads to fewer loc. it's annoying to have like 50loc of "get this config option! it's this type! default it to this value!" but it would be worse to have a 200loc one off macro just for this

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 a pull request may close this issue.

2 participants