Style Guide

Does pop have a style guide for rust? If so where can one find it?

8 points · 6 comments · view on lemmy.world

6 Comments

mmstick@lemmy.world · 5 pts · 3y (1 reply)

The style guide is to run cargo fmt. The default rustfmt configuration is good enough. Code should also pass cargo clippy without warnings. Some projects define a just check/just check-json recipe that runs cargo clippy --all-features -- -W clippy::pedantic to catch a plethora of additional suggestions from clippy that are disabled by default. Basic warnings about integer conversions can be annotated to allow them.

humanenough@lemm.ee · 0 pts · 2y

thank you

Nuuskis@sopuli.xyz · 2 pts · 3y (3 replies)

Do you mean framework?

InternetCitizen2@lemmy.world · 2 pts · 3y (2 replies)

No I mean something like this.

mmstick@lemmy.world · 2 pts · 3y (1 reply)

What Rust's maintainers recommend is what I'd recommend: https://rust-lang.github.io/api-guidelines/

Many of these are automatically detected and suggested by clippy's pedantic flag.

InternetCitizen2@lemmy.world · 1 pts · 3y

Thanks