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

Rust Programming

8011 readers
1 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
[โ€“] lemming_7765@lemmy.ml 2 points 1 year ago

Makes sense. I've also given a try to the flags I mentioned in rustfmt and they are apparently just for the nightly build, which makes me think they are working on it, which is good news (at least for me).

Sometimes having too much freedom when it comes to organizing code can be worse, I guess. But in general I prefer it to, for example, C, which was so picky with the placements of things.

Thanks for the feedback ๐Ÿ‘