---
source: crates/ruff_linter/src/rules/refurb/mod.rs
---
FURB171_1.py:3:4: FURB171 [*] Membership test against single-item container
  |
1 | # Errors.
2 |
3 | if 1 in set([1]):
  |    ^^^^^^^^^^^^^ FURB171
4 |     print("Single-element set")
  |
  = help: Convert to equality test

ℹ Safe fix
1 1 | # Errors.
2 2 | 
3   |-if 1 in set([1]):
  3 |+if 1 == 1:
4 4 |     print("Single-element set")
5 5 | 
6 6 | if 1 in set((1,)):

FURB171_1.py:6:4: FURB171 [*] Membership test against single-item container
  |
4 |     print("Single-element set")
5 |
6 | if 1 in set((1,)):
  |    ^^^^^^^^^^^^^^ FURB171
7 |     print("Single-element set")
  |
  = help: Convert to equality test

ℹ Safe fix
3 3 | if 1 in set([1]):
4 4 |     print("Single-element set")
5 5 | 
6   |-if 1 in set((1,)):
  6 |+if 1 == 1:
7 7 |     print("Single-element set")
8 8 | 
9 9 | if 1 in set({1}):

FURB171_1.py:9:4: FURB171 [*] Membership test against single-item container
   |
 7 |     print("Single-element set")
 8 |
 9 | if 1 in set({1}):
   |    ^^^^^^^^^^^^^ FURB171
10 |     print("Single-element set")
   |
   = help: Convert to equality test

ℹ Safe fix
6  6  | if 1 in set((1,)):
7  7  |     print("Single-element set")
8  8  | 
9     |-if 1 in set({1}):
   9  |+if 1 == 1:
10 10 |     print("Single-element set")
11 11 | 
12 12 | if 1 in frozenset([1]):

FURB171_1.py:12:4: FURB171 [*] Membership test against single-item container
   |
10 |     print("Single-element set")
11 |
12 | if 1 in frozenset([1]):
   |    ^^^^^^^^^^^^^^^^^^^ FURB171
13 |     print("Single-element set")
   |
   = help: Convert to equality test

ℹ Safe fix
9  9  | if 1 in set({1}):
10 10 |     print("Single-element set")
11 11 | 
12    |-if 1 in frozenset([1]):
   12 |+if 1 == 1:
13 13 |     print("Single-element set")
14 14 | 
15 15 | if 1 in frozenset((1,)):

FURB171_1.py:15:4: FURB171 [*] Membership test against single-item container
   |
13 |     print("Single-element set")
14 |
15 | if 1 in frozenset((1,)):
   |    ^^^^^^^^^^^^^^^^^^^^ FURB171
16 |     print("Single-element set")
   |
   = help: Convert to equality test

ℹ Safe fix
12 12 | if 1 in frozenset([1]):
13 13 |     print("Single-element set")
14 14 | 
15    |-if 1 in frozenset((1,)):
   15 |+if 1 == 1:
16 16 |     print("Single-element set")
17 17 | 
18 18 | if 1 in frozenset({1}):

FURB171_1.py:18:4: FURB171 [*] Membership test against single-item container
   |
16 |     print("Single-element set")
17 |
18 | if 1 in frozenset({1}):
   |    ^^^^^^^^^^^^^^^^^^^ FURB171
19 |     print("Single-element set")
   |
   = help: Convert to equality test

ℹ Safe fix
15 15 | if 1 in frozenset((1,)):
16 16 |     print("Single-element set")
17 17 | 
18    |-if 1 in frozenset({1}):
   18 |+if 1 == 1:
19 19 |     print("Single-element set")
20 20 | 
21 21 | if 1 in set(set([1])):

FURB171_1.py:21:4: FURB171 [*] Membership test against single-item container
   |
19 |     print("Single-element set")
20 |
21 | if 1 in set(set([1])):
   |    ^^^^^^^^^^^^^^^^^^ FURB171
22 |     print('Recursive solution')
   |
   = help: Convert to equality test

ℹ Safe fix
18 18 | if 1 in frozenset({1}):
19 19 |     print("Single-element set")
20 20 | 
21    |-if 1 in set(set([1])):
   21 |+if 1 == 1:
22 22 |     print('Recursive solution')
23 23 | 
24 24 |
