From 82ed5d328d27d8da12730ed428844ed72d9f1924 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Fri, 10 Sep 2021 11:01:45 -0400 Subject: [PATCH] Activity for testcase_list --- rustbyexample/hello/testcase_list.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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, "]")