cargo build- Build the projectcargo check- Check for compilation errors without buildingcargo test- Run all testscargo test <test_name>- Run specific testcargo run -- <args>- Run with arguments (e.g.,cargo run -- "hello world")cargo clippy- Run lintercargo fmt- Format code
- Language: Rust 2021 edition
- Imports: Group std, external crates, then local modules with blank lines between
- Documentation: Comprehensive doc comments for all public items using
/// - Error Handling: Use
anyhow::Result<T>for functions that can fail,thiserrorfor custom errors - Naming: snake_case for functions/variables, PascalCase for types, SCREAMING_SNAKE_CASE for constants
- Structure: Organize code in logical modules (main.rs, executor.rs, keymap.rs, wayland.rs)
- Comments: Detailed module-level comments explaining purpose and architecture
- Types: Explicit type annotations where helpful, prefer
u32for keycodes,Durationfor timing - Memory: Use
Vecfor dynamic collections,HashMapfor lookups, avoid unnecessary clones - Async: This is a synchronous CLI tool - no async/await patterns needed