boblaw0@lemmy.world to Rust@programming.dev · edit-210 months agoHow do you order your enums, structs and functions in your files?message-squaremessage-square8fedilinkarrow-up115arrow-down10
arrow-up115arrow-down1message-squareHow do you order your enums, structs and functions in your files?boblaw0@lemmy.world to Rust@programming.dev · edit-210 months agomessage-square8fedilink
minus-squarehairyballs@programming.devlinkfedilinkarrow-up3·edit-210 months ago I put the types first in the file, sorted by importance then the public free functions then the impl blocks, sorted by importance, also. Usually, display impls and similar end up being at the end then the private free functions (helpers) The idea is that I can see all the types in one glance, then I look at the rest.
The idea is that I can see all the types in one glance, then I look at the rest.