Is there something like "Rust Core Guidelines" (like "C++ Core Guidelines")?

In Rust, the preferred solution is to avoid the need for such document to exist. The language is designed to be easier to statically analyze, and makes the compiler check and enforce as much of the "guidelines" as possible, especially the important stuff around safety and correctness.

For more subjective and optional guidelines, there's still focus on not having such document, but an automation instead. There's cargo clippy with hundreds of lints detecting unidiomatic or suspiciously looking code, and a system for selectively allowing or disallowing these code patterns. Whenever a gotcha is discovered in Rust, instead of documenting the best practice that avoids it, someone writes a Clippy lint for it.

For general advice how to write idiomatic code, see

and also check out the most popular crates. They are often de-facto standards of how things are done in Rust:

17 Likes