---
source: crates/ruff_linter/src/rules/flake8_return/mod.rs
---
RET501.py:4:5: RET501 [*] Do not explicitly `return None` in function if it is the only possible return value
  |
2 |     if not y:
3 |         return
4 |     return None  # error
  |     ^^^^^^^^^^^ RET501
  |
  = help: Remove explicit `return None`

ℹ Safe fix
1 1 | def x(y):
2 2 |     if not y:
3 3 |         return
4   |-    return None  # error
  4 |+    return  # error
5 5 | 
6 6 | 
7 7 | class BaseCache:

RET501.py:14:9: RET501 [*] Do not explicitly `return None` in function if it is the only possible return value
   |
12 |     def get(self, key: str) -> None:
13 |         print(f"{key} not found")
14 |         return None
   |         ^^^^^^^^^^^ RET501
   |
   = help: Remove explicit `return None`

ℹ Safe fix
11 11 | 
12 12 |     def get(self, key: str) -> None:
13 13 |         print(f"{key} not found")
14    |-        return None
   14 |+        return


