「生活可以更简单, 欢迎来到我的开源世界」
rust命名规范
2020-11-30

原文:Naming - Rust API Guidelines (rust-lang.github.io)

Item Convention
Crates unclear
Modules snake_case
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
Macros snake_case!
Local variables snake_case
Statics SCREAMING_SNAKE_CASE
Constants SCREAMING_SNAKE_CASE
Type parameters concise , usually single uppercase letter: UpperCamelCase``T
Lifetimes short , usually a single letter: , , lowercase``'a``'de``'src
Features unclear but see C-FEATURE
<⇧>