cargo_metadata
cargo_metadata copied to clipboard
Split main code into modules
Currently most of the code live in the lib.rs
file. The file has reached almost 700 lines which can make it a bit confusing to navigate. I think it might be a good idea to split the code in smaller modules, something more like:
metadata.rs, target.rs, command.rs and so on an so forth. Then export everything from the main lib.rs. This approach comes with a cleaner separation of the various impls/structs which are seemingly scattered around the lib.rs file without a clear hierarchy. This is probably due too continuous addition to the originally simple lib.rs file which got progressively more complex.
I'd love to tackle this immediately as it's relatively straight foreword thing to do but it's probably better for #185 to be merged first otherwise we will drown in merge conflicts.
Another reason to consider splitting up the code is supporting other commands such as #107 although I'm not sure that it applies to cargo_metadata
I've used git too long and every time I see "submodule" I think it means git submodules; edited the title just for my sanity.