diff --git a/src/virtual_dom/mod.rs b/src/virtual_dom/mod.rs index 81aaa8f0ce2..bb31fd3ed45 100644 --- a/src/virtual_dom/mod.rs +++ b/src/virtual_dom/mod.rs @@ -84,13 +84,11 @@ impl Classes { impl ToString for Classes { fn to_string(&self) -> String { - let mut buf = String::new(); - for class in &self.set { - buf.push_str(class); - buf.push(' '); - } - buf.pop(); - buf + self.set + .iter() + .map(String::as_str) + .collect::>() + .join(" ") } }