From 87ed3a1bbd810626b9715b4f748666b2716a41a4 Mon Sep 17 00:00:00 2001 From: T0mstone <39707032+T0mstone@users.noreply.github.com> Date: Thu, 22 Apr 2021 15:09:44 +0200 Subject: [PATCH] Use `array::IntoIter` instead of copying (#80) --- core/editor/src/tools/mod.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/core/editor/src/tools/mod.rs b/core/editor/src/tools/mod.rs index 371ebe66..f3c1de13 100644 --- a/core/editor/src/tools/mod.rs +++ b/core/editor/src/tools/mod.rs @@ -98,14 +98,11 @@ impl ToolFsmState { fn default_tool_settings() -> HashMap { let tool_init = |tool: &ToolType| (*tool, tool.default_settings()); - // TODO: when 1.51 is more common, change this to use array::IntoIter - [ + std::array::IntoIter::new([ tool_init(&ToolType::Select), tool_init(&ToolType::Ellipse), tool_init(&ToolType::Shape), // TODO: Add more tool defaults - ] - .iter() - .copied() + ]) .collect() }