Skip to content

Split code #53

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

Open
wants to merge 56 commits into
base: master
Choose a base branch
from
Open

Split code #53

wants to merge 56 commits into from

Conversation

thibran
Copy link

@thibran thibran commented Mar 8, 2019

Hi,
at the beginning I did not plan to move so much code around, but here we are 😃
Before I go any further it might be a good idea to get some feedback from you and have a conversation to see where things go.

If you don't like my changes, feel happy to take only what you like or nothing at all (I'm not emotional attached to it – coding was just-for-fun). This code should behave exactly like the current master code.

Since the code has no tests, all I did was a quick manual test, through the split-up code structure should it make easier to write tests in future.

@Miserlou
Copy link
Owner

Miserlou commented Mar 8, 2019

@art-of-dom I'm curious what do you think?

@art-of-dom
Copy link
Collaborator

I think in general splitting the code up is a good idea in the long run to make it unit testable.

I however am not an expert at rust so I will not be as effective as a reviewer as I'd like to be. Glancing at it now, there are a few things that should be changed a bit.

src/main.rs Outdated
enum ErrorCode {
Any,
Code(u32),
process::exit(exit_status);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the process::exit should stick in main so we can unit test other functions that we call into. Having it here will always exit the process.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that should be the case.

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.

4 participants