@@ -20,30 +20,30 @@ official.
20
20
21
21
## General naming conventions
22
22
23
- In general, Rust tends to use ` CamelCase ` for "type-level" constructs
23
+ In general, Rust tends to use ` UpperCamelCase ` for "type-level" constructs
24
24
(types and traits) and ` snake_case ` for "value-level" constructs. More
25
25
precisely, the proposed (and mostly followed) conventions are:
26
26
27
27
| Item | Convention |
28
28
| ---- | ---------- |
29
29
| Crates | ` snake_case ` (but prefer single word) |
30
30
| Modules | ` snake_case ` |
31
- | Types | ` CamelCase ` |
32
- | Traits | ` CamelCase ` |
33
- | Enum variants | ` CamelCase ` |
31
+ | Types | ` UpperCamelCase ` |
32
+ | Traits | ` UpperCamelCase ` |
33
+ | Enum variants | ` UpperCamelCase ` |
34
34
| Functions | ` snake_case ` |
35
35
| Methods | ` snake_case ` |
36
36
| General constructors | ` new ` or ` with_more_details ` |
37
37
| Conversion constructors | ` from_some_other_type ` |
38
38
| Local variables | ` snake_case ` |
39
39
| Static variables | ` SCREAMING_SNAKE_CASE ` |
40
40
| Constant variables | ` SCREAMING_SNAKE_CASE ` |
41
- | Type parameters | concise ` CamelCase ` , usually single uppercase letter: ` T ` |
41
+ | Type parameters | concise ` UpperCamelCase ` , usually single uppercase letter: ` T ` |
42
42
| Lifetimes | short, lowercase: ` 'a ` |
43
43
44
44
### Fine points
45
45
46
- In ` CamelCase ` , acronyms count as one word: use ` Uuid ` rather than
46
+ In ` UpperCamelCase ` , acronyms count as one word: use ` Uuid ` rather than
47
47
` UUID ` . In ` snake_case ` , acronyms are lower-cased: ` is_xid_start ` .
48
48
49
49
In ` snake_case ` or ` SCREAMING_SNAKE_CASE ` , a "word" should never
0 commit comments