---
source: crates/ruff_linter/src/rules/flake8_return/mod.rs
---
RET508.py:8:9: RET508 Unnecessary `elif` after `break` statement
   |
 6 |         if i > y:  # [no-else-break]
 7 |             break
 8 |         elif i > w:
   |         ^^^^ RET508
 9 |             break
10 |         else:
   |
   = help: Remove unnecessary `elif`

RET508.py:22:9: RET508 Unnecessary `elif` after `break` statement
   |
20 |                 b = 2
21 |             break
22 |         elif z:
   |         ^^^^ RET508
23 |             c = 2
24 |         else:
   |
   = help: Remove unnecessary `elif`

RET508.py:33:9: RET508 Unnecessary `else` after `break` statement
   |
31 |         if i > y:  # [no-else-break]
32 |             break
33 |         else:
   |         ^^^^ RET508
34 |             a = z
   |
   = help: Remove unnecessary `else`

RET508.py:44:13: RET508 Unnecessary `else` after `break` statement
   |
42 |                 b = 2
43 |                 break
44 |             else:
   |             ^^^^ RET508
45 |                 c = 3
46 |                 break
   |
   = help: Remove unnecessary `else`

RET508.py:60:9: RET508 Unnecessary `else` after `break` statement
   |
58 |                 b = 2
59 |             break
60 |         else:
   |         ^^^^ RET508
61 |             c = 3
62 |         break
   |
   = help: Remove unnecessary `else`

RET508.py:71:13: RET508 Unnecessary `else` after `break` statement
   |
69 |                 a = 4
70 |                 break
71 |             else:
   |             ^^^^ RET508
72 |                 b = 2
73 |         else:
   |
   = help: Remove unnecessary `else`

RET508.py:82:9: RET508 Unnecessary `else` after `break` statement
   |
80 |         if x:  # [no-else-break]
81 |             break
82 |         else:
   |         ^^^^ RET508
83 |             try:
84 |                 return
   |
   = help: Remove unnecessary `else`

RET508.py:158:13: RET508 Unnecessary `else` after `break` statement
    |
156 |             if i > w:
157 |                 break
158 |             else:
    |             ^^^^ RET508
159 |                 a = z
    |
    = help: Remove unnecessary `else`


