Skip to content

Commit

Permalink
Merge pull request #2389 from shepmaster/pedantry-abounds-in-all-places
Browse files Browse the repository at this point in the history
Clarify we mean UpperCamelCase, not lowerCamelCase
  • Loading branch information
dtolnay authored May 30, 2018
2 parents 7a2ce51 + 633de5f commit cdd0053
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions text/0430-finalizing-naming-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,30 @@ official.

## General naming conventions

In general, Rust tends to use `CamelCase` for "type-level" constructs
In general, Rust tends to use `UpperCamelCase` for "type-level" constructs
(types and traits) and `snake_case` for "value-level" constructs. More
precisely, the proposed (and mostly followed) conventions are:

| Item | Convention |
| ---- | ---------- |
| Crates | `snake_case` (but prefer single word) |
| Modules | `snake_case` |
| Types | `CamelCase` |
| Traits | `CamelCase` |
| Enum variants | `CamelCase` |
| Types | `UpperCamelCase` |
| Traits | `UpperCamelCase` |
| Enum variants | `UpperCamelCase` |
| Functions | `snake_case` |
| Methods | `snake_case` |
| General constructors | `new` or `with_more_details` |
| Conversion constructors | `from_some_other_type` |
| Local variables | `snake_case` |
| Static variables | `SCREAMING_SNAKE_CASE` |
| Constant variables | `SCREAMING_SNAKE_CASE` |
| Type parameters | concise `CamelCase`, usually single uppercase letter: `T` |
| Type parameters | concise `UpperCamelCase`, usually single uppercase letter: `T` |
| Lifetimes | short, lowercase: `'a` |

### Fine points

In `CamelCase`, acronyms count as one word: use `Uuid` rather than
In `UpperCamelCase`, acronyms count as one word: use `Uuid` rather than
`UUID`. In `snake_case`, acronyms are lower-cased: `is_xid_start`.

In `snake_case` or `SCREAMING_SNAKE_CASE`, a "word" should never
Expand Down

0 comments on commit cdd0053

Please sign in to comment.