postpone clone after found (#1656)

pull/1657/head
Cydiater 3 years ago committed by GitHub
parent a19a6ca01e
commit 7083b98a38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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))
}
}

Loading…
Cancel
Save