From 7083b98a388b30e0b61caac9bf6ccc1d79eadf81 Mon Sep 17 00:00:00 2001 From: Cydiater Date: Sun, 13 Feb 2022 12:53:35 +0800 Subject: [PATCH] postpone clone after found (#1656) --- helix-term/src/commands.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 9918d26c..ded5a0e4 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -445,8 +445,8 @@ impl std::str::FromStr for MappableCommand { } else { MappableCommand::STATIC_COMMAND_LIST .iter() - .cloned() .find(|cmd| cmd.name() == s) + .cloned() .ok_or_else(|| anyhow!("No command named '{}'", s)) } }