Skip to content

Commit

Permalink
Tweak C-NAMING
Browse files Browse the repository at this point in the history
  • Loading branch information
crlf0710 committed Dec 26, 2023
1 parent e0e515b commit 6416361
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/naming.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ traits) and `snake_case` for "value-level" constructs. More precisely:
| Statics | `SCREAMING_SNAKE_CASE` |
| Constants | `SCREAMING_SNAKE_CASE` |
| Type parameters | concise `UpperCamelCase`, usually single uppercase letter: `T` |
| Lifetimes | short `lowercase`, usually a single letter: `'a`, `'de`, `'src` |
| Lifetimes | short `lowercase`: `'de`, `'src`, (for extremely simple cases) `'a` |
| Features | [unclear](https://github.com/rust-lang/api-guidelines/issues/101) but see [C-FEATURE] |

In `UpperCamelCase`, 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`.
Expand All @@ -34,7 +34,7 @@ In `snake_case` or `SCREAMING_SNAKE_CASE`, a "word" should never consist of a
single letter unless it is the last "word". So, we have `btree_map` rather than
`b_tree_map`, but `PI_2` rather than `PI2`.

Crate names should not use `-rs` or `-rust` as a suffix or prefix. Every crate
Crate names should not use `_rs`, `-rs` or `-rust` as a suffix or prefix. Every crate
is Rust! It serves no purpose to remind users of this constantly.

[RFC 430]: https://github.com/rust-lang/rfcs/blob/master/text/0430-finalizing-naming-conventions.md
Expand Down

0 comments on commit 6416361

Please sign in to comment.