Skip to content

Commit e8fef39

Browse files
authored
Merge pull request #4429 from youknowone/fix-format
Fix nightly clippy warnings
2 parents a4a5366 + 509cf7e commit e8fef39

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎ast/src/constant.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl std::fmt::Display for Constant {
4646
Constant::Int(i) => i.fmt(f),
4747
Constant::Tuple(tup) => {
4848
if let [elt] = &**tup {
49-
write!(f, "({},)", elt)
49+
write!(f, "({elt},)")
5050
} else {
5151
f.write_str("(")?;
5252
for (i, elt) in tup.iter().enumerate() {
@@ -61,9 +61,9 @@ impl std::fmt::Display for Constant {
6161
Constant::Float(fp) => f.pad(&rustpython_common::float_ops::to_string(*fp)),
6262
Constant::Complex { real, imag } => {
6363
if *real == 0.0 {
64-
write!(f, "{}j", imag)
64+
write!(f, "{imag}j")
6565
} else {
66-
write!(f, "({}{:+}j)", real, imag)
66+
write!(f, "({real}{imag:+}j)")
6767
}
6868
}
6969
Constant::Ellipsis => f.pad("..."),

‎ast/src/unparse.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ impl<'a> Unparser<'a> {
400400
.checked_sub(defaults_start)
401401
.and_then(|i| args.kw_defaults.get(i))
402402
{
403-
write!(self, "={}", default)?;
403+
write!(self, "={default}")?;
404404
}
405405
}
406406
if let Some(kwarg) = &args.kwarg {

0 commit comments

Comments
 (0)