mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-01 18:48:11 +08:00
Use array::IntoIter instead of copying (#80)
This commit is contained in:
committed by
Keavon Chambers
parent
c04a0227f1
commit
bafa81c7c5
@@ -98,14 +98,11 @@ impl ToolFsmState {
|
|||||||
|
|
||||||
fn default_tool_settings() -> HashMap<ToolType, ToolSettings> {
|
fn default_tool_settings() -> HashMap<ToolType, ToolSettings> {
|
||||||
let tool_init = |tool: &ToolType| (*tool, tool.default_settings());
|
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::Select),
|
||||||
tool_init(&ToolType::Ellipse),
|
tool_init(&ToolType::Ellipse),
|
||||||
tool_init(&ToolType::Shape), // TODO: Add more tool defaults
|
tool_init(&ToolType::Shape), // TODO: Add more tool defaults
|
||||||
]
|
])
|
||||||
.iter()
|
|
||||||
.copied()
|
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user