Skip to content

Commit

Permalink
style-guide: Clarify advice on names matching keywords
Browse files Browse the repository at this point in the history
In particular, specify what this advice is an alternative to (creative
misspellings such as `krate`).
  • Loading branch information
joshtriplett committed Jun 22, 2023
1 parent 6f8f83f commit fec28b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/doc/style-guide/src/advice.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ if y {
* Local variables shall be `snake_case`,
* Macro names shall be `snake_case`,
* Constants (`const`s and immutable `static`s) shall be `SCREAMING_SNAKE_CASE`.
* When a name is forbidden because it is a reserved word (e.g., `crate`), use a
trailing underscore to make the name legal (e.g., `crate_`), or use raw
identifiers if possible.
* When a name is forbidden because it is a reserved word (such as `crate`),
either use a raw identifier (`r#crate`) or use a trailing underscore
(`crate_`). Don't misspell the word (`krate`).

### Modules

Expand Down

0 comments on commit fec28b2

Please sign in to comment.