From 561d6af83205c31e27e1b39c1fe76fcb7ae0a2a4 Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Thu, 19 Sep 2024 09:21:39 +0200 Subject: [PATCH] Fix rendering of FURB188 docs --- .../rules/refurb/rules/slice_to_remove_prefix_or_suffix.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/ruff_linter/src/rules/refurb/rules/slice_to_remove_prefix_or_suffix.rs b/crates/ruff_linter/src/rules/refurb/rules/slice_to_remove_prefix_or_suffix.rs index e3fc11bfb6a36..1bc491a0fb53b 100644 --- a/crates/ruff_linter/src/rules/refurb/rules/slice_to_remove_prefix_or_suffix.rs +++ b/crates/ruff_linter/src/rules/refurb/rules/slice_to_remove_prefix_or_suffix.rs @@ -11,7 +11,8 @@ use ruff_text_size::{Ranged, TextLen}; /// the string to a slice after checking `.startswith()` or `.endswith()`, respectively. /// /// ## Why is this bad? -/// The methods [`str.removeprefix`] and [`str.removesuffix`], +/// The methods [`str.removeprefix`](https://docs.python.org/3/library/stdtypes.html#str.removeprefix) +/// and [`str.removesuffix`](https://docs.python.org/3/library/stdtypes.html#str.removesuffix), /// introduced in Python 3.9, have the same behavior /// and are more readable and efficient. /// @@ -33,9 +34,6 @@ use ruff_text_size::{Ranged, TextLen}; /// ```python /// text = text.removeprefix("pre") /// ``` -/// -/// [`str.removeprefix`]: https://docs.python.org/3/library/stdtypes.html#str.removeprefix -/// [`str.removesuffix`]: https://docs.python.org/3/library/stdtypes.html#str.removesuffix #[violation] pub struct SliceToRemovePrefixOrSuffix { string: String,