coding-guidelines

Installation
Summary

Rust naming, formatting, and best-practice guidelines covering 50 core rules.

  • Covers naming conventions (no get_ prefix, iterator patterns, conversion methods), data types (newtypes, slice patterns, pre-allocation), and string handling (prefer bytes for ASCII, use Cow<str> when appropriate)
  • Error handling guidance includes ? propagation over try!(), meaningful lifetime names, and lock ordering for concurrency safety
  • Includes deprecation mappings (e.g., lazy_static! to OnceLock, failure to thiserror) and quick reference for formatting, documentation, and linting standards
  • Designed as a reference for code review and style decisions in Rust projects
SKILL.md

Rust Coding Guidelines (50 Core Rules)

Naming (Rust-Specific)

Rule Guideline
No get_ prefix fn name() not fn get_name()
Iterator convention iter() / iter_mut() / into_iter()
Conversion naming as_ (cheap &), to_ (expensive), into_ (ownership)
Static var prefix G_CONFIG for static, no prefix for const

Data Types

Rule Guideline
Use newtypes struct Email(String) for domain semantics
Prefer slice patterns if let [first, .., last] = slice
Pre-allocate Vec::with_capacity(), String::with_capacity()
Avoid Vec abuse Use arrays for fixed sizes
Related skills

More from zhanghandong/rust-skills

Installs
1.1K
GitHub Stars
1.1K
First Seen
Jan 20, 2026