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

[Enhancement] New Option for Help, Initial Module, and Tests for the Source Code Documentation #6

Merged
merged 31 commits into from
May 20, 2022

Conversation

kevinmatthes
Copy link
Contributor

Hello, @wert007,

This Pull Request introduces the following new features:

  • a "help" option, as many CLIs have them,
  • an initial module in order to enhance the maintainability of the application, and
  • some initial source code documentation strings ("docstrings") for cargo doc.

This Pull Request is also intended to discuss the source code style in order to agree on some initial contribution guidelines.

@kevinmatthes
Copy link
Contributor Author

At the moment, the project consists of a single monolithic source file which might require additional effort to maintain the source code. Hence, I decided to outsource the features to dedicated modules. Together with the intended source code documentation, as discussed in #5, this procedure keeps the code better readable.

I decided to begin with the usage function since there was a small typo in its call. This issue was addressed by hard coding the application's name into the respective function because it is assumed to not being changed at runtime. Furthermore, due the removal of a single println ! () call, some small performance benefits were achieved.

@wert007
Copy link
Owner

wert007 commented May 19, 2022

Okay, before I start dissecting your pull request: Please run cargo fmt to auto format the code.

Secondly run cargo clippy which will lint your code to be up to rust standards. And follow the recommendations. 😄

@kevinmatthes
Copy link
Contributor Author

Okay, I applied your suggestions. Please note that the linter still complains about 6 regions which I do not edited with none of my commits.

I order to do not modify the behaviour of the application unintendedly, I would prefer to leave them as they are, at the moment.

@kevinmatthes
Copy link
Contributor Author

Mostly, the complaints concern the closures of .map_err. Once, the member merge: Option <String> is considered obsolete.

Copy link
Owner

@wert007 wert007 left a comment

Choose a reason for hiding this comment

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

Added some feedback here 😄

src/main.rs Outdated Show resolved Hide resolved
src/main.rs Outdated Show resolved Hide resolved
src/usage.rs Outdated Show resolved Hide resolved
src/usage.rs Outdated Show resolved Hide resolved
src/usage.rs Outdated Show resolved Hide resolved
src/main.rs Show resolved Hide resolved
@wert007
Copy link
Owner

wert007 commented May 19, 2022

Okay, I applied your suggestions. Please note that the linter still complains about 6 regions which I do not edited with none of my commits.

I order to do not modify the behaviour of the application unintendedly, I would prefer to leave them as they are, at the moment.

Yeah I saw that. I will fix these after the pull request merged I think 😅

src/main.rs Outdated Show resolved Hide resolved
Copy link
Owner

@wert007 wert007 left a comment

Choose a reason for hiding this comment

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

Great! 😄

@kevinmatthes
Copy link
Contributor Author

I just found out the solutions to the linter warnings. I am going to submit them to this Pull Request.

@kevinmatthes
Copy link
Contributor Author

The sole open linter warning concerns the unused merge member.

@wert007 wert007 merged commit dd7f30a into wert007:main May 20, 2022
@wert007
Copy link
Owner

wert007 commented May 20, 2022

Thanks, I merged it. And will now look at the unused merge field. 😄

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