bump MSRV to 1.83 (#16294)

According to our new MSRV policy (see
https://github.com/astral-sh/ruff/issues/16370 ), bump our MSRV to 1.83
(N - 2), and autofix some new clippy lints.
This commit is contained in:
Carl Meyer 2025-02-26 06:12:43 -08:00 committed by GitHub
parent bf2c9a41cd
commit dd6f6233bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
47 changed files with 85 additions and 93 deletions

View file

@ -65,7 +65,7 @@ impl<'a, 'builder> CommentsVisitor<'a, 'builder> {
fn can_skip(&mut self, node_end: TextSize) -> bool {
self.comment_ranges
.peek()
.map_or(true, |next_comment| next_comment.start() >= node_end)
.is_none_or(|next_comment| next_comment.start() >= node_end)
}
}

View file

@ -60,9 +60,9 @@ impl FormatNodeRule<ExprSlice> for FormatExprSlice {
// Handle spacing around the colon(s)
// https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#slices
let lower_simple = lower.as_ref().map_or(true, |expr| is_simple_expr(expr));
let upper_simple = upper.as_ref().map_or(true, |expr| is_simple_expr(expr));
let step_simple = step.as_ref().map_or(true, |expr| is_simple_expr(expr));
let lower_simple = lower.as_ref().is_none_or(|expr| is_simple_expr(expr));
let upper_simple = upper.as_ref().is_none_or(|expr| is_simple_expr(expr));
let step_simple = step.as_ref().is_none_or(|expr| is_simple_expr(expr));
let all_simple = lower_simple && upper_simple && step_simple;
// lower

View file

@ -49,8 +49,7 @@ impl FormatNodeRule<ParameterWithDefault> for FormatParameterWithDefault {
debug_assert!(equals.is_some_and(|token| token.kind == SimpleTokenKind::Equals));
let lparens = tokenizer.next();
debug_assert!(lparens
.as_ref()
.map_or(true, |token| token.kind == SimpleTokenKind::LParen));
.as_ref().is_none_or(|token| token.kind == SimpleTokenKind::LParen));
lparens.is_none()
});
let needs_line_break = needs_line_break_trailing || needs_line_break_leading;