Skip to content

Commit 8043a60

Browse files
committed
Documentation
1 parent c9457ea commit 8043a60

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/ruff_linter/src/rules/pylint/rules/repeated_equality_comparison.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ use crate::Locator;
1818
/// Checks for repeated equality comparisons that can be rewritten as a membership
1919
/// test.
2020
///
21+
/// This rule will try to determine if the values are hashable
22+
/// and the fix will use a `set` if they are. If unable to determine, the fix
23+
/// will use a `tuple` and suggest the use of a `set`.
24+
///
2125
/// ## Why is this bad?
2226
/// To check if a variable is equal to one of many values, it is common to
2327
/// write a series of equality comparisons (e.g.,
@@ -28,10 +32,6 @@ use crate::Locator;
2832
/// If the items are hashable, use a `set` for efficiency; otherwise, use a
2933
/// `tuple`.
3034
///
31-
/// This rule will try to determine if the values are hashable
32-
/// and the fix will use a `set` if they are. If unable to determine, the fix
33-
/// will use a `tuple` and continue to suggest the use of a `set`.
34-
///
3535
/// ## Example
3636
/// ```python
3737
/// foo == "bar" or foo == "baz" or foo == "qux"

0 commit comments

Comments
 (0)