Skip to content

Commit

Permalink
Clarify we mean UpperCamelCase, not lowerCamelCase
Browse files Browse the repository at this point in the history
  • Loading branch information
shepmaster committed May 30, 2018
1 parent 7a2ce51 commit 633de5f
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 633de5f

Please sign in to comment.