Rust conventions

From wikinotes
Revision as of 15:33, 8 February 2023 by Will (talk | contribs) (→‎Casing)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Naming

Casing

struct Foo { ... }               // types, enums, structs.. are CamelCase
mod math_things { ... }          // modules are snake_case
fn do_thing() { ... }            // functions are snake_case
let user_name: &str = "vaderd";  // variables are snake_case

Spacing

4x spaces