From 0cd3b07efadc14a0494ad3199d3487441c4077e5 Mon Sep 17 00:00:00 2001 From: trag1c Date: Sat, 2 Mar 2024 00:50:52 +0100 Subject: [PATCH] Removed unused variable in `TRY300`'s example (#10190) ## Summary Removes the unnecessary `exc` variable in `TRY300`'s docs example. ## Test Plan ``` python scripts/generate_mkdocs.py; mkdocs serve -f mkdocs.public.yml ``` --- .../src/rules/tryceratops/rules/try_consider_else.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ruff_linter/src/rules/tryceratops/rules/try_consider_else.rs b/crates/ruff_linter/src/rules/tryceratops/rules/try_consider_else.rs index 60aa30e7ca..9783cacac0 100644 --- a/crates/ruff_linter/src/rules/tryceratops/rules/try_consider_else.rs +++ b/crates/ruff_linter/src/rules/tryceratops/rules/try_consider_else.rs @@ -25,7 +25,7 @@ use crate::checkers::ast::Checker; /// rec = 1 / n /// print(f"reciprocal of {n} is {rec}") /// return rec -/// except ZeroDivisionError as exc: +/// except ZeroDivisionError: /// logging.exception("Exception occurred") /// ``` /// @@ -37,7 +37,7 @@ use crate::checkers::ast::Checker; /// def reciprocal(n): /// try: /// rec = 1 / n -/// except ZeroDivisionError as exc: +/// except ZeroDivisionError: /// logging.exception("Exception occurred") /// else: /// print(f"reciprocal of {n} is {rec}")