improve HintEnum::ToString

This commit is contained in:
Simon Gardling 2022-04-06 14:42:51 -04:00
parent a65874cf51
commit b3fea0e9ba

View File

@ -54,14 +54,15 @@ impl ToString for HintEnum<'static> {
"[".to_owned() "[".to_owned()
+ &multi_data + &multi_data
.iter() .iter()
.map(|x| r#"""#.to_string() + x + r#"""#)
.enumerate() .enumerate()
.map(|(i, x)| { .map(|(i, x)| {
let mut tmp = r#"""#.to_string() + x + r#"""#;
// Add comma and space if needed // Add comma and space if needed
if max_i > i as i32 { if max_i > i as i32 {
tmp += ", "; return x + ", ";
} else {
return x;
} }
tmp
}) })
.collect::<Vec<String>>() .collect::<Vec<String>>()
.concat() + "]" .concat() + "]"