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

Separate main.rs into main.rs and lib.rs #27

Closed
wants to merge 1 commit into from
Closed

Conversation

faern
Copy link
Member

@faern faern commented Oct 10, 2024

Keeping main.rs slim and doing most logic in the library. I find that to be a good thing to strive for. Avoiding too large modules is a good idea in general. So if we can separate CLI parsing from the rest that's a good start.

This also makes it possible to attach doc tests to stuff in lib.rs. Documentation tests don't run for main.rs. At the same time potentially makes the library part more testable, since you can write integration tests against library crates, but not binary crates.

Keeping main.rs slim and doing most logic in the library.
* Separates CLI stuff from the functionality of the program.
* Makes it possible to have doc tests in lib.rs
* Can potentially make the library more testable
@faern
Copy link
Member Author

faern commented Nov 29, 2024

As discussed AFK: We want to eventually publish this to crates.io. But we don't want people to use this as a library and we don't (currently) want to provide some library API stability. We should as a result avoid having a lib.rs. We can still make the file split into modules, but avoiding lib.rs. Maybe we can think through the module split a bit more. Closing for now.

@faern faern closed this Nov 29, 2024
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

Successfully merging this pull request may close these issues.

2 participants