use std::fmt; pub fn deco_entries(entries: KVS, de: &str) -> String where K: fmt::Display, V: fmt::Display, KVS: IntoIterator { let lines = entries.into_iter() .map(|(k, v)| format!(" {}{}{},", k, de, v)) .collect::>(); // let lines: Vec = mapper(entries, |k, v| format!(" {}{}{},", k, de, v)); return format!("{{\n{}\n}}", lines.join("\n")); }