diff --git a/src/database.rs b/src/database.rs index 0a81b5a..02cd955 100644 --- a/src/database.rs +++ b/src/database.rs @@ -329,11 +329,14 @@ pub fn row_to_json(row: &PgRow) -> HashMap { } pub fn vec_to_string(vec: Vec) -> String { - vec.iter().fold(String::new(), |mut output, b| { - let s = b.to_string(); - let _ = write!(output, "{s}"); - output - }) + let mut content = String::new(); + for (i, elem) in vec.iter().enumerate() { + content.push_str(&elem.to_string()); + if i != vec.len() - 1 { + content.push_str(", "); + } + } + "{ ".to_owned() + &*content + &*" }".to_owned() } pub fn row_to_vec(row: &PgRow) -> Vec {