What problem does it solve?
Provides a concise, prescriptive set of Rust best-practice rules to keep repository Rust code consistent, safe, and maintainable across services and contributors, emphasizing Edition 2024 compatibility, error handling, ownership patterns, async runtimes, and logging conventions.
Core Features & Use Cases
- Edition and project structure: Require edition = 2024 and a clean lib.rs / main.rs separation to keep entrypoints thin.
- Error handling guidance: Prefer thiserror-derived domain errors and restrict anyhow to binary entrypoints.
- Ownership, async, and logging: Favor borrowing over cloning, use tokio for async and tracing for logs, and avoid println!/eprintln!.
- Visibility and exhaustiveness: Default to pub(crate) for non-public APIs and prefer explicit match arms to detect future variants.
- Use case: Use during code edits, PR reviews, or when implementing rask-log-aggregator, rask-log-forwarder, or recap-worker services to align code with repository standards.
Quick Start
Review the modified Rust file and apply the bp-rust guidelines from docs/best_practices/rust.md so it uses edition = 2024, thiserror for domain errors, pub(crate) visibility by default, borrow-first argument patterns, tokio and tracing, and a minimal main.rs.