use std::collections::{HashMap, HashSet};
+use std::fmt::Write;
use std::io::BufRead;
use std::iter::Iterator;
fn render_column_headers(columns: &[String]) -> String {
// TODO: Escape HTML special characters
String::from("<th></th>")
- + &columns
- .iter()
- .map(|c| format!("<th>{c}</th>"))
- .collect::<String>()
+ + &columns.iter().fold(String::new(), |mut acc, c| {
+ write!(&mut acc, "<th>{c}</th>").unwrap();
+ acc
+ })
+ "\n"
}