mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-08 05:35:22 +00:00
Merge pull request #4429 from youknowone/fix-format
Fix nightly clippy warnings
This commit is contained in:
commit
566c7c4179
2 changed files with 4 additions and 4 deletions
|
@ -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("..."),
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue