File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -15,12 +15,17 @@ declare_clippy_lint! {
1515 /// use of bools in structs.
1616 ///
1717 /// ### Why is this bad?
18- /// Excessive bools in a struct
19- /// is often a sign that it's used as a state machine,
20- /// which is much better implemented as an enum.
21- /// If it's not the case, excessive bools usually benefit
22- /// from refactoring into two-variant enums for better
23- /// readability and API.
18+ /// Excessive bools in a struct is often a sign that
19+ /// the type is being used to represent a state
20+ /// machine, which is much better implemented as an
21+ /// enum.
22+ ///
23+ /// The reason an enum is better for state machines
24+ /// over structs is that enums more easily forbid
25+ /// invalid states.
26+ ///
27+ /// Structs with too many booleans may benefit from refactoring
28+ /// into multi variant enums for better readability and API.
2429 ///
2530 /// ### Example
2631 /// ```no_run
You can’t perform that action at this time.
0 commit comments