diff --git a/crates/ruff/src/rules/flake8_simplify/rules/ast_if.rs b/crates/ruff/src/rules/flake8_simplify/rules/ast_if.rs index b62fece84c8f3..35994aeead294 100644 --- a/crates/ruff/src/rules/flake8_simplify/rules/ast_if.rs +++ b/crates/ruff/src/rules/flake8_simplify/rules/ast_if.rs @@ -91,9 +91,9 @@ define_violation!( /// /// ### Example /// ```python - /// if x = 1: + /// if x == 1: /// return "Hello" - /// elif x = 2: + /// elif x == 2: /// return "Goodbye" /// else: /// return "Goodnight" diff --git a/docs/rules/if-to-dict.md b/docs/rules/if-to-dict.md deleted file mode 100644 index cf96b4fb5df04..0000000000000 --- a/docs/rules/if-to-dict.md +++ /dev/null @@ -1,26 +0,0 @@ -# if-to-dict (SIM116) - -Derived from the **flake8-simplify** linter. - -Autofix is always available. - -### What it does -Checks for three or more consecutive if-statements with direct returns - -### Why is this bad? -These can be simplified by using a dictionary - -### Example -```python -if x = 1: - return "Hello" -elif x = 2: - return "Goodbye" -else: - return "Goodnight" -``` - -Use instead: -```python -return {1: "Hello", 2: "Goodbye"}.get(x, "Goodnight") -``` \ No newline at end of file