Skip to content

Commit 88e5666

Browse files
use display_comma_separated
1 parent 161658a commit 88e5666

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/ast/mod.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5345,16 +5345,17 @@ impl fmt::Display for Statement {
53455345
Statement::List(command) => write!(f, "LIST {command}"),
53465346
Statement::Remove(command) => write!(f, "REMOVE {command}"),
53475347
Statement::SetSessionParam(kind) => write!(f, "SET {kind}"),
5348-
Statement::SetVariables { variables, values } => {
5349-
write!(f, "SET ")?;
5350-
variables
5351-
.iter()
5352-
.zip(values.iter())
5353-
.map(|(var, val)| format!("{var} = {val}"))
5354-
.collect::<Vec<_>>()
5355-
.join(", ")
5356-
.fmt(f)
5357-
}
5348+
Statement::SetVariables { variables, values } => write!(
5349+
f,
5350+
"SET {}",
5351+
display_comma_separated(
5352+
&variables
5353+
.iter()
5354+
.zip(values.iter())
5355+
.map(|(var, val)| format!("{var} = {val}"))
5356+
.collect::<Vec<_>>()
5357+
)
5358+
),
53585359
}
53595360
}
53605361
}

0 commit comments

Comments
 (0)