[ruff UP031, issue #10187] cargo clippy

This commit is contained in:
PLR 2024-04-18 17:42:23 -07:00
parent 27dbae994b
commit e86dd7d0cb

View file

@ -325,20 +325,19 @@ fn clean_params_variable<'a>(checker: &mut Checker, right: &Expr) -> Option<Cow<
}
// 1-tuple
Expr::Tuple(ast::ExprTuple { elts, .. }) if 1 == elts.len() => {
return Some(Cow::Owned(format!("({}[0])", rt)));
return Some(Cow::Owned(format!("({rt}[0])")));
}
// non-tuple
_ => {
return Some(Cow::Owned(format!("({})", rt)));
return Some(Cow::Owned(format!("({rt})")));
}
}
}
// when find_binding_value doesn't work, fall back to offering a fix only for non-tuples
if analyze::typing::is_tuple(binding, semantic) {
return None;
} else {
return Some(Cow::Owned(format!("({})", rt)));
}
return Some(Cow::Owned(format!("({rt})")));
}
/// Returns `true` if the sequence of [`PercentFormatPart`] indicate that an