Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split main code into modules #192

Open
morr0ne opened this issue Jul 1, 2022 · 3 comments
Open

Split main code into modules #192

morr0ne opened this issue Jul 1, 2022 · 3 comments

Comments

@morr0ne
Copy link
Contributor

morr0ne commented Jul 1, 2022

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.

@morr0ne
Copy link
Contributor Author

morr0ne commented Jul 1, 2022

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.

@morr0ne
Copy link
Contributor Author

morr0ne commented Jul 1, 2022

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

@jyn514 jyn514 changed the title Split main code in submodules Split main code into modules Jul 10, 2022
@jyn514
Copy link
Collaborator

jyn514 commented Jul 10, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants