-
Notifications
You must be signed in to change notification settings - Fork 28
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
base: master
Are you sure you want to change the base?
Split code #53
Conversation
@art-of-dom I'm curious what do you think? |
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.