Skip to content

Commit fec28b2

Browse files
committed
style-guide: Clarify advice on names matching keywords
In particular, specify what this advice is an alternative to (creative misspellings such as `krate`).
1 parent 6f8f83f commit fec28b2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/doc/style-guide/src/advice.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ if y {
2525
* Local variables shall be `snake_case`,
2626
* Macro names shall be `snake_case`,
2727
* Constants (`const`s and immutable `static`s) shall be `SCREAMING_SNAKE_CASE`.
28-
* When a name is forbidden because it is a reserved word (e.g., `crate`), use a
29-
trailing underscore to make the name legal (e.g., `crate_`), or use raw
30-
identifiers if possible.
28+
* When a name is forbidden because it is a reserved word (such as `crate`),
29+
either use a raw identifier (`r#crate`) or use a trailing underscore
30+
(`crate_`). Don't misspell the word (`krate`).
3131

3232
### Modules
3333

0 commit comments

Comments
 (0)