Skip to content

Commit 92ccc35

Browse files
committed
PascalCase has leading capitalization, camelCase does not 🐪
Because it looks like a camel with a single hump in the middle: 🐪
1 parent dfc5dfa commit 92ccc35

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/naming.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66

77
Basic Rust naming conventions are described in [RFC 430].
88

9-
In general, Rust tends to use `CamelCase` for "type-level" constructs (types and
9+
In general, Rust tends to use `PascalCase` for "type-level" constructs (types and
1010
traits) and `snake_case` for "value-level" constructs. More precisely:
1111

1212
| Item | Convention |
1313
| ---- | ---------- |
1414
| Crates | [unclear](https://github.com/rust-lang-nursery/api-guidelines/issues/29) |
1515
| Modules | `snake_case` |
16-
| Types | `CamelCase` |
17-
| Traits | `CamelCase` |
18-
| Enum variants | `CamelCase` |
16+
| Types | `PascalCase` |
17+
| Traits | `PascalCase` |
18+
| Enum variants | `PascalCase` |
1919
| Functions | `snake_case` |
2020
| Methods | `snake_case` |
2121
| General constructors | `new` or `with_more_details` |
@@ -24,11 +24,11 @@ traits) and `snake_case` for "value-level" constructs. More precisely:
2424
| Local variables | `snake_case` |
2525
| Statics | `SCREAMING_SNAKE_CASE` |
2626
| Constants | `SCREAMING_SNAKE_CASE` |
27-
| Type parameters | concise `CamelCase`, usually single uppercase letter: `T` |
27+
| Type parameters | concise `PascalCase`, usually single uppercase letter: `T` |
2828
| Lifetimes | short `lowercase`, usually a single letter: `'a`, `'de`, `'src` |
2929
| Features | [unclear](https://github.com/rust-lang-nursery/api-guidelines/issues/101) but see [C-FEATURE] |
3030

31-
In `CamelCase`, acronyms and contractions of compound words count as one word: use `Uuid` rather than `UUID`, `Usize` rather than `USize` or `Stdin` rather than `StdIn`. In `snake_case`, acronyms and contractions are lower-cased: `is_xid_start`.
31+
In `PascalCase`, acronyms and contractions of compound words count as one word: use `Uuid` rather than `UUID`, `Usize` rather than `USize` or `Stdin` rather than `StdIn`. In `snake_case`, acronyms and contractions are lower-cased: `is_xid_start`.
3232

3333
In `snake_case` or `SCREAMING_SNAKE_CASE`, a "word" should never consist of a
3434
single letter unless it is the last "word". So, we have `btree_map` rather than

0 commit comments

Comments
 (0)