A sleek, modern illustration of the Rust programming language: a gear-shaped logo surrounded by snippets of Rust code with syntax highlighting, a terminal window showing cargo build, and an organized file tree (src/, Cargo.toml). Background with a dark theme and orange/bronze highlights. Style: minimalist, dev-centric, clean.
lib.rs
, main.rs
, and clear module hierarchy. - Use src/bin/
for multiple binaries; avoid cramming everything into main.rs
.clippy
and rustfmt
before committing. - Favor Result<T, E>
over panics in libraries. - Document public functions, structs, and modules with ///
doc comments.Cargo.toml
clean; avoid unused or overly permissive dependencies. - Use specific versions (no *
) and prefer crates with good maintenance.Error
enums) over anyhow
in libraries. - Use thiserror
or eyre
for ergonomic error management when appropriate. - Avoid using .unwrap()
or .expect()
outside of tests or prototyping.#[cfg(test)]
blocks. - Favor assert_eq!
, assert_matches!
, and structured error testing. - Include basic CI tasks: cargo check
, cargo test
, cargo clippy
.unsafe
unless there's no alternative and document its usage explicitly. - Profile performance before optimizing; use cargo bench
, perf
, or criterion
.