---
source: crates/ruff_linter/src/rules/refurb/mod.rs
---
FURB132.py:12:1: FURB132 [*] Use `s.discard("x")` instead of check and `remove`
   |
11 |   # FURB132
12 | / if "x" in s:
13 | |     s.remove("x")
   | |_________________^ FURB132
   |
   = help: Replace with `s.discard("x")`

ℹ Unsafe fix
9  9  | # these should match
10 10 | 
11 11 | # FURB132
12    |-if "x" in s:
13    |-    s.remove("x")
   12 |+s.discard("x")
14 13 | 
15 14 | 
16 15 | # FURB132

FURB132.py:22:1: FURB132 [*] Use `s3.discard("x")` instead of check and `remove`
   |
21 |   # FURB132
22 | / if "x" in s3:
23 | |     s3.remove("x")
   | |__________________^ FURB132
   |
   = help: Replace with `s3.discard("x")`

ℹ Unsafe fix
19 19 | 
20 20 | 
21 21 | # FURB132
22    |-if "x" in s3:
23    |-    s3.remove("x")
   22 |+s3.discard("x")
24 23 | 
25 24 | 
26 25 | var = "y"

FURB132.py:28:1: FURB132 [*] Use `s.discard(var)` instead of check and `remove`
   |
26 |   var = "y"
27 |   # FURB132
28 | / if var in s:
29 | |     s.remove(var)
   | |_________________^ FURB132
   |
   = help: Replace with `s.discard(var)`

ℹ Unsafe fix
25 25 | 
26 26 | var = "y"
27 27 | # FURB132
28    |-if var in s:
29    |-    s.remove(var)
   28 |+s.discard(var)
30 29 | 
31 30 | 
32 31 | if f"{var}:{var}" in s:

FURB132.py:32:1: FURB132 [*] Use `s.discard(f"{var}:{var}")` instead of check and `remove`
   |
32 | / if f"{var}:{var}" in s:
33 | |     s.remove(f"{var}:{var}")
   | |____________________________^ FURB132
   |
   = help: Replace with `s.discard(f"{var}:{var}")`

ℹ Unsafe fix
29 29 |     s.remove(var)
30 30 | 
31 31 | 
32    |-if f"{var}:{var}" in s:
33    |-    s.remove(f"{var}:{var}")
   32 |+s.discard(f"{var}:{var}")
34 33 | 
35 34 | 
36 35 | def identity(x):


