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

Rename modules to follow new convention #843

Closed
wants to merge 1 commit into from

Conversation

PoignardAzur
Copy link
Contributor

Rename module files from foobar/mod.rs to foobar/_foobar.rs.

The full name is for readability when multiple module files are open in a text editor. The leading underscore is so these names appear first in file hierarchies.

Rename module files from `foobar/mod.rs` to `foobar/_foobar.rs`.

The full name is for readability when multiple module files are open in a text editor.
The leading underscore is so these names appear first in file hierarchies.
@PoignardAzur
Copy link
Contributor Author

There should probably be an open debate as to whether we adopt this convention.

The upsides are as listed in the commit message.
The downsides are that this is surprising for someone reading the code eg on Github.

Copy link
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly object to this - we should not break from idiomatic Rust without very good reason.
I'm happy to be overruled if there's strong consensus in the other direction, especially if this is to be localised to Masonry.

I understand that you use an editor which is derivative of the VScode project, and so would suggest you use the Customise Tab Labels feature for this purpose. I have a rule set up which does this for me (not to hand)

Certainly I can see the appeal of sorting the mod.rs file first. I imagine there are already upstream issues tracking this in Rust Analyzer - I know that vscode has some neat tricks around file organisation contributed by extensions

@PoignardAzur
Copy link
Contributor Author

I know that vscode has some neat tricks around file organisation contributed by extensions

It doesn't, actually: microsoft/vscode#27286

In any case, I'm not going to push for this if there's strong objection.

@canklot

This comment has been minimized.

@PoignardAzur PoignardAzur deleted the change_module_convention branch January 24, 2025 12:06
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.

3 participants