-
Notifications
You must be signed in to change notification settings - Fork 13
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
crate: Tidy up some out of place types #160
Conversation
Hey, sorry for responding so late to this. pub use protocols::types::{ExtraRequestSettings, TimeoutSettings}; in
Well said, I would say it would be better in |
Yes this would be same for library consumer, but I was also thinking it might be better for maintaining if the files are more organized (I'm not sure if the way I've done here is actually more organized).
Yeah, that makes more sense, especially since each game no longer has its own file. |
I wouldn't think so. |
So move from the games mod.rs to query.rs and types.rs. Yeah I agree the placement of ExtraRequest and TimeoutSettings isnt better. Im not sure where they are currently is the best place but I don't think where I moved them is better. So I'll leave that as is and just add re-exports in the root of the library to make consumption easier. |
This resolves conflicts in - crates/cli/src/main.rs - TimeoutSettings/ExtraRequestSettings moved - crates/lib/src/games/mod.rs - savage2 added but query functions were moved to new file
My main aim here was to move types that are likely to be used by consumers of the library into the root scope of the library. I'm not sure if this is good practice but I thought it would be helpful:
TimeoutSettings
andExtraRequestSettings
are now just ingamedig::
so users using generic query don't need to delve deep into the protocol type module.I also moved the generic query functions, they should never have been in in the
games/mod.rs
file in the first place, although I'm not sure whether it would be better for them to be ingames/query.rs
or maybe evenprotocols/query.rs
.Where possible I added deprecation warnings in the old place, so the aliases can be removed in the future.