Format let-else with rustfmt nightly (#5461)

Support for `let…else` formatting was just merged to nightly
(rust-lang/rust#113225). Rerun `cargo fmt` with Rust nightly 2023-07-02
to pick this up. Followup to #939.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg 2023-07-02 19:13:35 -07:00 committed by GitHub
parent c8b9a46e2b
commit df13e69c3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
105 changed files with 782 additions and 362 deletions

View file

@ -20,7 +20,11 @@ use crate::model::SemanticModel;
pub fn is_logger_candidate(func: &Expr, semantic: &SemanticModel) -> bool {
if let Expr::Attribute(ast::ExprAttribute { value, .. }) = func {
let Some(call_path) = (if let Some(call_path) = semantic.resolve_call_path(value) {
if call_path.first().map_or(false, |module| *module == "logging") || call_path.as_slice() == ["flask", "current_app", "logger"] {
if call_path
.first()
.map_or(false, |module| *module == "logging")
|| call_path.as_slice() == ["flask", "current_app", "logger"]
{
Some(call_path)
} else {
None