Skip to content

Commit 58bab51

Browse files
authored
move modules from kebab-case to snake_case (#14439)
<!-- homu-ignore:start --> <!-- Thanks for submitting a pull request 🎉! Here are some tips for you: * If this is your first contribution, read "Cargo Contribution Guide" first: https://doc.crates.io/contrib/ * Run `cargo fmt --all` to format your code changes. * Small commits and pull requests are always preferable and easy to review. * If your idea is large and needs feedback from the community, read how: https://doc.crates.io/contrib/process/#working-on-large-features * Cargo takes care of compatibility. Read our design principles: https://doc.crates.io/contrib/design.html * When changing help text of cargo commands, follow the steps to generate docs: https://github.com/rust-lang/cargo/tree/master/src/doc#building-the-man-pages * If your PR is not finished, set it as "draft" PR or add "WIP" in its title. * It's ok to use the CI resources to test your PR, but please don't abuse them. ### What does this PR try to resolve? Explain the motivation behind this change. A clear overview along with an in-depth explanation are helpful. You can use `Fixes #<issue number>` to associate this PR to an existing issue. ### How should we test and review this PR? Demonstrate how you test this change and guide reviewers through your PR. With a smooth review process, a pull request usually gets reviewed quicker. If you don't know how to write and run your tests, please read the guide: https://doc.crates.io/contrib/tests ### Additional information Other information you want to mention in this PR, such as prior arts, future extensions, an unresolved problem, or a TODO list. --> <!-- homu-ignore:end --> ### What does this PR try to resolve? It is currently unclear reading the docs how files should be named. [RFC 430](https://rust-lang.github.io/rfcs/0430-finalizing-naming-conventions.html) is clear on crates and module names, `kebab-case` is never mentioned and while there are historical considerations, we should guide new development towards `snake_case`. We should align the documented defaults to that RFC. ### How should we test and review this PR? Review the docs and determine if we view value in the change.
2 parents 949858c + f8984e1 commit 58bab51

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/doc/src/guide/project-layout.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ files, place a `main.rs` file along with the extra [*modules*][def-module]
4848
within a subdirectory of the `src/bin`, `examples`, `benches`, or `tests`
4949
directory. The name of the executable will be the directory name.
5050

51+
> **Note:** By convention, binaries, examples, benches and integration tests follow `kebab-case` naming style, unless there are compatibility reasons to do otherwise (e.g. compatibility with a pre-existing binary name). Modules within those targets are `snake_case` following the [Rust standard](https://rust-lang.github.io/rfcs/0430-finalizing-naming-conventions.html).
52+
5153
You can learn more about Rust's module system in [the book][book-modules].
5254

5355
See [Configuring a target] for more details on manually configuring targets.

0 commit comments

Comments
 (0)