Skip to content

Commit

Permalink
[ruff UP031, issue #10187] cargo clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
plredmond committed Apr 19, 2024
1 parent 27dbae9 commit e86dd7d
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e86dd7d

Please sign in to comment.