mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-03 05:54:33 +00:00
Fix warns
This commit is contained in:
parent
0019147007
commit
44781cb030
19 changed files with 96 additions and 99 deletions
|
@ -553,7 +553,7 @@ impl NestedDisplay for ArrayComprehension {
|
|||
fn fmt_nest(&self, f: &mut fmt::Formatter<'_>, _level: usize) -> fmt::Result {
|
||||
let mut generators = String::new();
|
||||
for (name, gen) in self.generators.iter() {
|
||||
write!(generators, "{} <- {}, ", name, gen).unwrap();
|
||||
write!(generators, "{name} <- {gen}, ")?;
|
||||
}
|
||||
write!(
|
||||
f,
|
||||
|
@ -890,7 +890,7 @@ impl NestedDisplay for MixedRecord {
|
|||
fn fmt_nest(&self, f: &mut fmt::Formatter<'_>, _level: usize) -> fmt::Result {
|
||||
write!(f, "{{")?;
|
||||
for attr in self.attrs.iter() {
|
||||
write!(f, "{}; ", attr)?;
|
||||
write!(f, "{attr}; ")?;
|
||||
}
|
||||
write!(f, "}}")
|
||||
}
|
||||
|
@ -1063,7 +1063,7 @@ impl NestedDisplay for Call {
|
|||
write!(f, "{}", self.obj)?;
|
||||
}
|
||||
if let Some(attr_name) = self.attr_name.as_ref() {
|
||||
write!(f, "{}", attr_name)?;
|
||||
write!(f, "{attr_name}")?;
|
||||
}
|
||||
if self.args.is_empty() {
|
||||
write!(f, "()")
|
||||
|
@ -2654,11 +2654,11 @@ impl NestedDisplay for VarPattern {
|
|||
fn fmt_nest(&self, f: &mut fmt::Formatter<'_>, _level: usize) -> fmt::Result {
|
||||
match self {
|
||||
Self::Discard(_) => write!(f, "_"),
|
||||
Self::Ident(ident) => write!(f, "{}", ident),
|
||||
Self::Array(a) => write!(f, "{}", a),
|
||||
Self::Tuple(t) => write!(f, "{}", t),
|
||||
Self::Record(r) => write!(f, "{}", r),
|
||||
Self::DataPack(d) => write!(f, "{}", d),
|
||||
Self::Ident(ident) => write!(f, "{ident}"),
|
||||
Self::Array(a) => write!(f, "{a}"),
|
||||
Self::Tuple(t) => write!(f, "{t}"),
|
||||
Self::Record(r) => write!(f, "{r}"),
|
||||
Self::DataPack(d) => write!(f, "{d}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2921,14 +2921,14 @@ pub enum ParamPattern {
|
|||
impl NestedDisplay for ParamPattern {
|
||||
fn fmt_nest(&self, f: &mut fmt::Formatter<'_>, _level: usize) -> fmt::Result {
|
||||
match self {
|
||||
Self::Discard(tok) => write!(f, "{}", tok),
|
||||
Self::VarName(var_name) => write!(f, "{}", var_name),
|
||||
Self::Lit(lit) => write!(f, "{}", lit),
|
||||
Self::Array(array) => write!(f, "{}", array),
|
||||
Self::Tuple(tuple) => write!(f, "{}", tuple),
|
||||
Self::Record(record) => write!(f, "{}", record),
|
||||
Self::Ref(var_name) => write!(f, "ref {}", var_name),
|
||||
Self::RefMut(var_name) => write!(f, "ref! {}", var_name),
|
||||
Self::Discard(tok) => write!(f, "{tok}"),
|
||||
Self::VarName(var_name) => write!(f, "{var_name}"),
|
||||
Self::Lit(lit) => write!(f, "{lit}"),
|
||||
Self::Array(array) => write!(f, "{array}"),
|
||||
Self::Tuple(tuple) => write!(f, "{tuple}"),
|
||||
Self::Record(record) => write!(f, "{record}"),
|
||||
Self::Ref(var_name) => write!(f, "ref {var_name}"),
|
||||
Self::RefMut(var_name) => write!(f, "ref! {var_name}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue