snarkVM
snarkVM copied to clipboard
[Proposal] Put the struct implementations together with the struct definition
💥 Proposal
There are instances of modules that define a single or a few methods over a struct, separated from the actual struct definition. This hurts readability and increases complexity, since these standalone definitions can be understood out of the context of the structure (ie. it's not obvious what struct/entity is defining a given function).
Some examples of this practice: https://github.com/AleoHQ/snarkVM/blob/HEAD/vm/compiler/src/ledger/get.rs https://github.com/AleoHQ/snarkVM/blob/HEAD/circuit/program/src/data/plaintext/find.rs https://github.com/AleoHQ/snarkVM/blob/HEAD/console/algorithms/src/poseidon/hash.rs