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

refactor: better NO_COLOR support #95

Merged
merged 2 commits into from
Oct 15, 2021
Merged

refactor: better NO_COLOR support #95

merged 2 commits into from
Oct 15, 2021

Conversation

figsoda
Copy link
Member

@figsoda figsoda commented Oct 15, 2021

Fixes #62
Fixes #66

colors::* are now lazy statics that respect NO_COLOR instead of pure functions

  • colors::yellow() -> *colors::YELLOW
  • if *NO_COLOR_IS_SET is no longer needed outside of colors module

switched from lazy_static to once_cell since it doesn't use macros and the code can look a little cleaner

@marcospb19 marcospb19 added the hacktoberfest-accepted Tag PR as accepted for the hacktoberfest event label Oct 15, 2021
@marcospb19
Copy link
Member

marcospb19 commented Oct 15, 2021

That's pretty good, loved the code.

You're solving not only #62, but also #66.

Thanks!

@figsoda
Copy link
Member Author

figsoda commented Oct 15, 2021

Thanks for the review!
I edited to close that issue too

@marcospb19 marcospb19 merged commit 8224aab into ouch-org:master Oct 15, 2021
@figsoda figsoda deleted the refactor-colors branch October 15, 2021 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Tag PR as accepted for the hacktoberfest event
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simplify colors implementation to remove code duplication The help message does not respect NO_COLOR
2 participants