Closed Douile closed 9 months ago
Hey, sorry for responding so late to this. I do think that moving (or re-exporting) those types would be great for usage, but wouldn't just having
pub use protocols::types::{ExtraRequestSettings, TimeoutSettings};
in lib.rs
be the same thing? Hope I don't miss on anything.
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 in games/query.rs or maybe even protocols/query.rs.
Well said, I would say it would be better in games/query.rs
.
in lib.rs be the same thing? Hope I don't miss on anything.
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).
Well said, I would say it would be better in games/query.rs.
Yeah, that makes more sense, especially since each game no longer has its own file.
(I'm not sure if the way I've done here is actually more organized)
I wouldn't think so.
They are primarily used for protocols, so I think they belong in the protocols folder.
But I do think that the types
file is a bit too cluttered, I think it could benefit of some extraction, thoughts?
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.
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.