-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Rename mod.rs files to self.rs #128
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
Conversation
|
||
# Motivation | ||
|
||
The name _self.rs_ feels more logical for this purpose given how `self` in module-scope refers to the enclosing module. Also, `Self` is used to refer to the enclosing trait, so there's a strong precedent of using "self" to refer to the enclosing "thing". For a _self.rs_ file, the enclosing "thing" is the folder it lies in, and that folder's name is the name of the module for which the _self.rs_ file is the implementation. |
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.
Self
is used to refer to the type implementing the enclosing trait, not the trait itself.
I think this is a worthwhile change for consistency, and the changeover wouldn't be much trouble. |
I strongly prefer |
I like to the keep the name of the module separate from the directory structure. This means you can copy & paste it to another project without needing to change the name in the source.
|
i am a newbie so take my view with a grain of salt doesn't self refer to too many things already? this is bound to be confusing for newbies. |
We could have a nice correspondence between import-trees and files/folders given the changes discussed here and particularly demonstrated by this comment |
For those unaware, You could say the same for I think Edited for clarity. |
I prefer mod.rs. |
Thanks for taking the time to write an RFC! We talked about this at today's triage meeting, and we've decided to not change the conventions which we have in place today. |
Rendered view