From 509cf7ed0dd1b08bb49c684302bbf8b11cf5fd27 Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Sat, 7 Jan 2023 20:14:24 +0900 Subject: [PATCH] Fix nightly clippy warnings --- ast/src/constant.rs | 6 +++--- ast/src/unparse.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ast/src/constant.rs b/ast/src/constant.rs index 373f5f9..adec47a 100644 --- a/ast/src/constant.rs +++ b/ast/src/constant.rs @@ -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("..."), diff --git a/ast/src/unparse.rs b/ast/src/unparse.rs index 70addae..551283c 100644 --- a/ast/src/unparse.rs +++ b/ast/src/unparse.rs @@ -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 {