Upgrade Rust toolchain to 1.84.0 (#15408)
Some checks are pending
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (linux, release) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Waiting to run
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz build (push) Blocked by required conditions
CI / fuzz parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions

This commit is contained in:
Micha Reiser 2025-01-11 09:51:58 +01:00 committed by GitHub
parent 2d82445794
commit c39ca8fe6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 36 additions and 45 deletions

View file

@ -540,7 +540,7 @@ fn is_docstring_section(
// The return value of the function.
// """
// ```
if previous_line.map_or(false, |line| line.trim().is_empty()) {
if previous_line.is_some_and(|line| line.trim().is_empty()) {
return true;
}

View file

@ -38,7 +38,7 @@ pub(crate) fn fix_file(
diagnostic
.fix
.as_ref()
.map_or(false, |fix| fix.applies(required_applicability))
.is_some_and(|fix| fix.applies(required_applicability))
})
.peekable();

View file

@ -78,11 +78,7 @@ impl<'a> Directive<'a> {
comment_start = text[..comment_start].trim_end().len();
// The next character has to be the `#` character.
if text[..comment_start]
.chars()
.last()
.map_or(true, |c| c != '#')
{
if !text[..comment_start].ends_with('#') {
continue;
}
comment_start -= '#'.len_utf8();

View file

@ -493,7 +493,7 @@ pub(crate) fn f_strings(checker: &mut Checker, call: &ast::ExprCall, summary: &F
checker
.semantic()
.resolve_qualified_name(call.func.as_ref())
.map_or(false, |qualified_name| {
.is_some_and(|qualified_name| {
matches!(
qualified_name.segments(),
["django", "utils", "translation", "gettext" | "gettext_lazy"]

View file

@ -145,7 +145,7 @@ pub(crate) fn super_call_with_parameters(checker: &mut Checker, call: &ast::Expr
.resolve_qualified_name(func)
.is_some_and(|name| name.segments() == ["dataclasses", "dataclass"])
{
arguments.find_keyword("slots").map_or(false, |keyword| {
arguments.find_keyword("slots").is_some_and(|keyword| {
matches!(
keyword.value,
Expr::BooleanLiteral(ast::ExprBooleanLiteral { value: true, .. })

View file

@ -117,7 +117,7 @@ fn in_subscript_index(expr: &ExprSubscript, semantic: &SemanticModel) -> bool {
}
// E.g., `Generic[DType, Unpack[int]]`.
if parent.slice.as_tuple_expr().map_or(false, |slice| {
if parent.slice.as_tuple_expr().is_some_and(|slice| {
slice
.elts
.iter()
@ -144,5 +144,5 @@ fn in_vararg(expr: &ExprSubscript, semantic: &SemanticModel) -> bool {
.as_ref()
.and_then(|vararg| vararg.annotation.as_ref())
.and_then(|annotation| annotation.as_subscript_expr())
.map_or(false, |annotation| annotation == expr)
== Some(expr)
}

View file

@ -144,7 +144,7 @@ pub(crate) fn print_empty_string(checker: &mut Checker, call: &ast::ExprCall) {
let empty_separator = call
.arguments
.find_keyword("sep")
.map_or(false, |keyword| is_empty_string(&keyword.value));
.is_some_and(|keyword| is_empty_string(&keyword.value));
if !empty_separator {
return;
}