Merge pull request #4429 from youknowone/fix-format

Fix nightly clippy warnings
This commit is contained in:
Jeong YunWon 2023-01-07 21:38:41 +09:00 committed by GitHub
commit e8fef39861
2 changed files with 4 additions and 4 deletions

View file

@ -46,7 +46,7 @@ impl std::fmt::Display for Constant {
Constant::Int(i) => i.fmt(f),
Constant::Tuple(tup) => {
if let [elt] = &**tup {
write!(f, "({},)", elt)
write!(f, "({elt},)")
} else {
f.write_str("(")?;
for (i, elt) in tup.iter().enumerate() {
@ -61,9 +61,9 @@ impl std::fmt::Display for Constant {
Constant::Float(fp) => f.pad(&rustpython_common::float_ops::to_string(*fp)),
Constant::Complex { real, imag } => {
if *real == 0.0 {
write!(f, "{}j", imag)
write!(f, "{imag}j")
} else {
write!(f, "({}{:+}j)", real, imag)
write!(f, "({real}{imag:+}j)")
}
}
Constant::Ellipsis => f.pad("..."),

View file

@ -400,7 +400,7 @@ impl<'a> Unparser<'a> {
.checked_sub(defaults_start)
.and_then(|i| args.kw_defaults.get(i))
{
write!(self, "={}", default)?;
write!(self, "={default}")?;
}
}
if let Some(kwarg) = &args.kwarg {