diff options
Diffstat (limited to 'src/docs/struct_excessive_bools.txt')
| -rw-r--r-- | src/docs/struct_excessive_bools.txt | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/docs/struct_excessive_bools.txt b/src/docs/struct_excessive_bools.txt deleted file mode 100644 index 9e197c78620..00000000000 --- a/src/docs/struct_excessive_bools.txt +++ /dev/null @@ -1,29 +0,0 @@ -### What it does -Checks for excessive -use of bools in structs. - -### Why is this bad? -Excessive bools in a struct -is often a sign that it's used as a state machine, -which is much better implemented as an enum. -If it's not the case, excessive bools usually benefit -from refactoring into two-variant enums for better -readability and API. - -### Example -``` -struct S { - is_pending: bool, - is_processing: bool, - is_finished: bool, -} -``` - -Use instead: -``` -enum S { - Pending, - Processing, - Finished, -} -``` \ No newline at end of file |
