Skip to content

Commit d3530ab

Browse files
authored
Fix rendering of FURB188 docs (#13406)
1 parent cf1e91b commit d3530ab

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

crates/ruff_linter/src/rules/refurb/rules/slice_to_remove_prefix_or_suffix.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ use ruff_text_size::{Ranged, TextLen};
1111
/// the string to a slice after checking `.startswith()` or `.endswith()`, respectively.
1212
///
1313
/// ## Why is this bad?
14-
/// The methods [`str.removeprefix`] and [`str.removesuffix`],
14+
/// The methods [`str.removeprefix`](https://docs.python.org/3/library/stdtypes.html#str.removeprefix)
15+
/// and [`str.removesuffix`](https://docs.python.org/3/library/stdtypes.html#str.removesuffix),
1516
/// introduced in Python 3.9, have the same behavior
1617
/// and are more readable and efficient.
1718
///
@@ -33,9 +34,6 @@ use ruff_text_size::{Ranged, TextLen};
3334
/// ```python
3435
/// text = text.removeprefix("pre")
3536
/// ```
36-
///
37-
/// [`str.removeprefix`]: https://docs.python.org/3/library/stdtypes.html#str.removeprefix
38-
/// [`str.removesuffix`]: https://docs.python.org/3/library/stdtypes.html#str.removesuffix
3937
#[violation]
4038
pub struct SliceToRemovePrefixOrSuffix {
4139
string: String,

0 commit comments

Comments
 (0)