File tree 1 file changed +11
-6
lines changed 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -15,12 +15,17 @@ declare_clippy_lint! {
15
15
/// use of bools in structs.
16
16
///
17
17
/// ### 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.
24
29
///
25
30
/// ### Example
26
31
/// ```no_run
You can’t perform that action at this time.
0 commit comments