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: removed some mod.rs files #24

Merged
merged 1 commit into from
Sep 7, 2023
Merged

refactor: removed some mod.rs files #24

merged 1 commit into from
Sep 7, 2023

Conversation

gmosx
Copy link
Owner

@gmosx gmosx commented Sep 6, 2023

No description provided.

@gmosx
Copy link
Owner Author

gmosx commented Sep 6, 2023

I think mod.rs files where used in older editions of rust, I would like to eventually replace those for consistency. This is a first step cc @allanbrondumkr

@allanbrondumkr
Copy link
Contributor

Ok

I think mod.rs files where used in older editions of rust, I would like to eventually replace those for consistency. This is a first step cc @allanbrondumkr

Ok, that is mainly a matter of style/convention, I think both is fine. Though why do you think it is related to old editions of Rust? Both approaches are valid in Rust, and I think using mod.rs is the most common for modules that have submodules.

@allanbrondumkr
Copy link
Contributor

allanbrondumkr commented Sep 6, 2023

Ok

I think mod.rs files where used in older editions of rust, I would like to eventually replace those for consistency. This is a first step cc @allanbrondumkr

Ok, that is mainly a matter of style/convention, I think both is fine. Though why do you think it is related to old editions of Rust? Both approaches are valid in Rust, and I think using mod.rs is the most common for modules that have submodules.

Maybe you are right, I've just seen mod.rs used most frequently, but maybe the other approach is the recommended way to do it now.

@allanbrondumkr
Copy link
Contributor

allanbrondumkr commented Sep 6, 2023

I found this reference for it, guess it makes sense https://doc.rust-lang.org/reference/items/modules.html#module-source-filenames. I also don't like that all files are named mod.rs, though I like that code related to a module is in one folder, so pros and cons. But it is the recommended way, so that must decide :)

@gmosx gmosx merged commit cf74a6c into main Sep 7, 2023
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.

2 participants