Skip to content

Commit ba7b656

Browse files
gzsomborms705
authored andcommitted
Use 'join' function to collect the arguments
1 parent 35a4f30 commit ba7b656

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/column.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ pub struct FunctionArguments {
4646

4747
impl Display for FunctionArguments {
4848
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
49-
let mut first = true;
50-
for argument in self.arguments.iter() {
51-
if !first {
52-
write!(f, ",")?;
53-
} else {
54-
first = false;
55-
}
56-
write!(f, "{}", argument)?;
57-
}
49+
write!(
50+
f,
51+
"{}",
52+
self.arguments
53+
.iter()
54+
.map(|arg| format!("{}", arg))
55+
.collect::<Vec<String>>()
56+
.join(",")
57+
)?;
5858
Ok(())
5959
}
6060
}

0 commit comments

Comments
 (0)