Rust Style Guide

Use the Rust edition and toolchain declared in the repository. Keep crates and features explicit in Cargo manifests.

  • Use snake_case for functions and modules, PascalCase for types.
  • Prefer borrowing over unnecessary cloning and small explicit interfaces.
  • Return Result for recoverable errors. Avoid panics and unchecked unwraps in library and production paths.
  • Document unsafe blocks with the invariants that make them valid; prefer safe Rust.
  • Follow the repository’s Cargo.lock policy.
pub fn normalize_name(value: &str) -> &str {
    value.trim()
}

Run cargo fmt, cargo clippy, cargo build and cargo test through configured targets. Test relevant feature combinations without publishing crates.