10.3 风格向导(Style Guide)

大写 (Capitalization)

In Sway, structs, traits, and enums are CapitalCase. Modules, variables, and functions are snake_case, constants are SCREAMING_SNAKE_CASE. The compiler will warn you if your capitalization is ever unidiomatic.

在 Sway 中,结构、特征和穷举都是大写 CapitalCase。模块、变量和函数是snake_case,常量是SCREAMING_SNAKE_CASE。如果你的大写字母不同意用,编译器会警告你。

Last updated