mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00
Upgrade Rust toolchain to 1.83 (#14677)
This commit is contained in:
parent
a6402fb51e
commit
b63c2e126b
63 changed files with 127 additions and 127 deletions
|
@ -881,7 +881,7 @@ impl Format<PyFormatContext<'_>> for Operand<'_> {
|
|||
fn fmt(&self, f: &mut Formatter<PyFormatContext<'_>>) -> FormatResult<()> {
|
||||
let expression = self.expression();
|
||||
|
||||
return if is_expression_parenthesized(
|
||||
if is_expression_parenthesized(
|
||||
expression.into(),
|
||||
f.context().comments().ranges(),
|
||||
f.context().source(),
|
||||
|
@ -1017,7 +1017,7 @@ impl Format<PyFormatContext<'_>> for Operand<'_> {
|
|||
Ok(())
|
||||
} else {
|
||||
expression.format().with_options(Parentheses::Never).fmt(f)
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -133,9 +133,7 @@ impl FormatNodeRule<ExprTuple> for FormatExprTuple {
|
|||
// ```
|
||||
// In all other cases comments get assigned to a list element
|
||||
match elts.as_slice() {
|
||||
[] => {
|
||||
return empty_parenthesized("(", dangling, ")").fmt(f);
|
||||
}
|
||||
[] => empty_parenthesized("(", dangling, ")").fmt(f),
|
||||
[single] => match self.parentheses {
|
||||
TupleParentheses::Preserve if !is_parenthesized => {
|
||||
single.format().fmt(f)?;
|
||||
|
|
|
@ -14,7 +14,7 @@ pub(super) enum AnyExpressionYield<'a> {
|
|||
YieldFrom(&'a ExprYieldFrom),
|
||||
}
|
||||
|
||||
impl<'a> AnyExpressionYield<'a> {
|
||||
impl AnyExpressionYield<'_> {
|
||||
const fn is_yield_from(&self) -> bool {
|
||||
matches!(self, AnyExpressionYield::YieldFrom(_))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue