Code Review Guidelines
Rust PR reviews balance soundness, API design, and operability. Reviewers prioritize panics, unsafe, async blocking, error mapping, and dependency changes.
Busca en todas las páginas de la documentación
Rust PR reviews balance soundness, API design, and operability. Reviewers prioritize panics, unsafe, async blocking, error mapping, and dependency changes.
Reviewers scan in this order:
When to reach for this:
// Blocking DB in async handler
async fn handler() {
std::thread::sleep(Duration::from_secs(1)); // BLOCKER
}
// unwrap in library code
pub fn parse(s: &str) -> User {
serde_json::from_str(s).unwrap() // BLOCKER in domain crate
}
// unsafe without SAFETY comment
unsafe { ptr.read() } // BLOCKERcargo deny / team approvalCargo.lock missing on binary crate dep bump#[instrument] on new async service boundary| Area | Look for |
|---|---|
| Errors | Typed errors, no leaked internals in HTTP |
| Async | spawn_blocking for CPU/ sync IO |
| SQL | Parameterized queries, migration included |
| API | Breaking changes noted, semver bump |
| Tests | Unit + integration for failure paths |
| Docs | Public items documented |
| Observability | tracing on new endpoints |
Ask questions ("Could this lock across await?") over accusations. Link to cookbook sections.
| Alternative | Use When | Don't Use When |
|---|---|---|
| Pair review | Complex unsafe/FFI | Routine small fix |
| LGTM bot + human | High volume | Junior-only team |
| Architectural review | New service | Typo fix |
Under 24 hours for <400 line PRs; author splits larger diffs.
Required: read diff on GitHub before requesting review.
Auth, crypto, unsafe, new external input parsers, dependency with advisory.
Stack versions: This page was written for Rust 1.97.0 (edition 2024), Tokio 1.x, Axum 0.8, serde 1.0, sqlx 0.8, clap 4, and Polars 0.46+.
Revisado por Chris St. John·Última actualización: 16 jul 2026