mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 20:42:10 +00:00
Parenthesize match..case
if
guards (#13513)
This commit is contained in:
parent
8012707348
commit
9442cd8fae
7 changed files with 155 additions and 88 deletions
|
@ -59,6 +59,10 @@ pub(crate) enum Parenthesize {
|
|||
/// Same as [`Self::IfBreaks`] except that it uses [`parenthesize_if_expands`] for expressions
|
||||
/// with the layout [`NeedsParentheses::BestFit`] which is used by non-splittable
|
||||
/// expressions like literals, name, and strings.
|
||||
///
|
||||
/// Use this layout over `IfBreaks` when there's a sequence of `maybe_parenthesize_expression`
|
||||
/// in a single logical-line and you want to break from right-to-left. Use `IfBreaks` for the
|
||||
/// first expression and `IfBreaksParenthesized` for the rest.
|
||||
IfBreaksParenthesized,
|
||||
|
||||
/// Same as [`Self::IfBreaksParenthesized`] but uses [`parenthesize_if_expands`] for nested
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue