-
Notifications
You must be signed in to change notification settings - Fork 6
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
Module splitting #31
Module splitting #31
Conversation
Hi @RustyNova016, for the next release (0.8.1) I'd like to merge this PR first, but there are merge conflicts now. Would you be able to solve those? If not, feel free to close this PR and create a new one. I really like these changes though, great job 👍 |
d64f118
to
6da2c0c
Compare
I finally got arround to finishing it. |
Thanks @RustyNova016 !! I will have a look later today.
Haha, no problem at all. I'll see what I can do. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how you guys feel @RustyNova016 @shymega, but my personal preference for naming modules is <name>.rs
over <name>/mod.rs
.
With the latter, if you have multiple modules open in your editor they will all show up as mod.rs
.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, my personal way of doing modules is based on logical assertions.
- If a module is limited to one module only, and does not use
mod
in the file, then$module.rs
is suitable. - If a module requires other files in the same directly, then the module should be called
src/$moduleName/mod.rs
, and usemod $child
/pub mod $child
in$moduleName/mod.rs
, and work that way.
I usually use the same logic as you @shymega, but here i's just future proofing. Some pages might need to be split more, so I already made the mods ready to expand. If it's an issue, I can put it back as single files. (It's pretty easy with the vscode extension) |
Yeah, I don't disagree with future proofing. I mean, we're getting a steady stream of contributions (thank you!), and I think it makes sense to start preparing for future additions, making new PR diffs smaller. @InputUsername What do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After giving it some thought, I think this approach is fine. Everything looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks!
I started splitting the modules into multiples ones according to #25. For now only Core is made, but I am creating this pull request for tracking and initial review
Here's some details:
response_type
macro to have absolute paths and thus being able to be used in children modules.{request type} {apipath}
, like shown in the official documentation. While the original ones are closer to string formatting, the new ones are easier to find with a ctrl-f from the official documentation.