this post was submitted on 13 Apr 2023
8 points (100.0% liked)

Rust Programming

8163 readers
4 users here now

founded 5 years ago
MODERATORS
 

I would like to know if there are any proposals for internal file organization, like what to put from top to bottom...

Example: start with pub use declarations, then use, the mod, enums, traits, etc.

I've seen rustfmt has some options like reorder_imports that may impose some partial structure, but I would like a more comprehensive guide/spec...

If there's nothing like that. Can we maybe discuss something that makes sense? 🤔

you are viewing a single comment's thread
view the rest of the comments
[–] scouten@ericscouten.social 2 points 2 years ago (1 children)

@lemming_7765 since things can be expressed in more or less any order, I like the idea of putting the most important things first and then working down from there.

Not my original idea but I can’t remember the origin.

[–] lemming_7765@lemmy.ml 1 points 2 years ago

So, hierarchichal top down, I guess. With main types before subordinate ones. Right?