improve HintEnum::ToString
This commit is contained in:
parent
a65874cf51
commit
b3fea0e9ba
@ -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() + "]"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user