diff --git a/rustbyexample/hello/testcase_list.rs b/rustbyexample/hello/testcase_list.rs index 2f29761..263da30 100644 --- a/rustbyexample/hello/testcase_list.rs +++ b/rustbyexample/hello/testcase_list.rs @@ -8,9 +8,11 @@ impl fmt::Display for List { write!(f, "[")?; - for (count, v ) in vec.iter().enumerate() { - if count != 0 { write!(f, ", ")?; } - write!(f, "{}", v)?; + for (count, v) in vec.iter().enumerate() { + if count != 0 { + write!(f, ", ")?; + } + write!(f, "{}: {}", count, v)?; } write!(f, "]")