• 3 Posts
  • 6 Comments
Joined 1 year ago
cake
Cake day: March 30th, 2023

help-circle

  • 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 👍


  • That’s more or less what I do. However I usually struggle with enum, traits, functions and structs inside the same group. So, for example, if I’m in the public group:

    1. do I mix them all and sort alphabetically or hierarchically (like the post https://lemmy.ml/comment/414806 suggests)?
    2. do I put enums, traits and functions first since they are usually prerequisites for the following types? Meaning that an enum will probably be used in a struct or trait, so we may want to present it before to the reader.
    3. any other sorting…

    🤔