mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-03 07:04:53 +00:00
Simplify IfRequired needs parentheses condition (#6678)
This commit is contained in:
parent
2a8d24dd4b
commit
8b347cdaa9
2 changed files with 5 additions and 13 deletions
|
@ -23,12 +23,6 @@ pub(crate) enum OptionalParentheses {
|
|||
Never,
|
||||
}
|
||||
|
||||
impl OptionalParentheses {
|
||||
pub(crate) const fn is_always(self) -> bool {
|
||||
matches!(self, OptionalParentheses::Always)
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) trait NeedsParentheses {
|
||||
/// Determines if this object needs optional parentheses or if it is safe to omit the parentheses.
|
||||
fn needs_parentheses(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue