Skip to content

Commit 2f5f5ac

Browse files
committed
Rollup merge of #29193 - kini:filename-conventions, r=alexcrichton
When reading this paragraph, the beginning Rust programmer is starting to write a Hello World program. We have just told her to name the file `main.rs`, and immediately afterward, a `hello_world.rs` is mentioned. I changed this to an unrelated filename (incidentally one that appears in this repository) to make it clear that this is just an example. Also, wording it as a declarative sentence rather than an imperative one further separates it from the Hello World instructions in this section. r? @steveklabnik (Let me know if I'm sending too many PRs -- I can batch up TRPL edits, say, per chapter, if that works better. Or I can just refrain from editing TRPL as I read through it, if these are not sufficiently useful.)
2 parents 6ed13c9 + 79102e3 commit 2f5f5ac

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/doc/trpl/hello-world.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ If we’re on Windows and not using PowerShell, the `~` may not work. Consult th
3737
documentation for our shell for more details.
3838

3939
Let’s make a new source file next. We’ll call our file `main.rs`. Rust files
40-
always end in a `.rs` extension. If we’re using more than one word in our
41-
filename, use an underscore: `hello_world.rs` rather than `helloworld.rs`.
40+
always end in a `.rs` extension, and if we’re using more than one word in a
41+
Rust filename, we use an underscore: for example, `linked_list.rs`, not
42+
`linkedlist.rs` or `LinkedList.rs`.
4243

4344
Now that we’ve got our file open, type this in:
4445

0 commit comments

Comments
 (0)