src: add STRONG_BOOL to replace bool args - #65142
Open
jasnell wants to merge 2 commits into
Open
Conversation
Signed-off-by: James M Snell <jasnell@gmail.com>
Mostly a demonstration of how to use STRONG_BOOL. The idea here is provide a workable alternative to using bool arguments where the callsites would otherwise be somehting like `foo(true)` (what does setting `true` mean here!?) to `foo(Bar::YES)` (more self-documenting and readable). The pattern here is adopted from what we do in workerd and it's been a good quality of life improvement. Signed-off-by: James M Snell <jasnell@gmail.com>
Collaborator
|
Review requested:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #65142 +/- ##
=======================================
Coverage 90.32% 90.32%
=======================================
Files 759 759
Lines 248320 248329 +9
Branches 46868 46861 -7
=======================================
+ Hits 224296 224307 +11
+ Misses 15466 15464 -2
Partials 8558 8558
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adopts the concept of strong bool arguments. Gives us a way to avoid bool args...
e.g.
changes to: