mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-03 07:04:37 +00:00
Fix rendering of FURB188 docs (#13406)
This commit is contained in:
parent
cf1e91bb59
commit
d3530ab997
1 changed files with 2 additions and 4 deletions
|
@ -11,7 +11,8 @@ use ruff_text_size::{Ranged, TextLen};
|
||||||
/// the string to a slice after checking `.startswith()` or `.endswith()`, respectively.
|
/// the string to a slice after checking `.startswith()` or `.endswith()`, respectively.
|
||||||
///
|
///
|
||||||
/// ## Why is this bad?
|
/// ## 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
|
/// introduced in Python 3.9, have the same behavior
|
||||||
/// and are more readable and efficient.
|
/// and are more readable and efficient.
|
||||||
///
|
///
|
||||||
|
@ -33,9 +34,6 @@ use ruff_text_size::{Ranged, TextLen};
|
||||||
/// ```python
|
/// ```python
|
||||||
/// text = text.removeprefix("pre")
|
/// 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]
|
#[violation]
|
||||||
pub struct SliceToRemovePrefixOrSuffix {
|
pub struct SliceToRemovePrefixOrSuffix {
|
||||||
string: String,
|
string: String,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue