mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Use array::IntoIter instead of copying (#80)
This commit is contained in:
committed by
Keavon Chambers
parent
46c9ef02ca
commit
87ed3a1bbd
@@ -98,14 +98,11 @@ impl ToolFsmState {
|
||||
|
||||
fn default_tool_settings() -> HashMap<ToolType, ToolSettings> {
|
||||
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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user