From 144d94178abfe1caee35916e0f1263cff27dbb9d Mon Sep 17 00:00:00 2001 From: Basti Ortiz <39114273+Some-Dood@users.noreply.github.com> Date: Fri, 29 Oct 2021 16:26:36 +0800 Subject: [PATCH] Chore: prefer `HashMap::from` over collecting `Vec` of tuples --- src/bin/cargo/cli.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/cargo/cli.rs b/src/bin/cargo/cli.rs index 81e9f1262ce..e0df4523cf0 100644 --- a/src/bin/cargo/cli.rs +++ b/src/bin/cargo/cli.rs @@ -15,10 +15,10 @@ lazy_static::lazy_static! { // Maps from commonly known external commands (not builtin to cargo) to their // description, for the help page. Reserved for external subcommands that are // core within the rust ecosystem (esp ones that might become internal in the future). - static ref KNOWN_EXTERNAL_COMMAND_DESCRIPTIONS: HashMap<&'static str, &'static str> = vec![ + static ref KNOWN_EXTERNAL_COMMAND_DESCRIPTIONS: HashMap<&'static str, &'static str> = HashMap::from([ ("clippy", "Checks a package to catch common mistakes and improve your Rust code."), ("fmt", "Formats all bin and lib files of the current crate using rustfmt."), - ].into_iter().collect(); + ]); } pub fn main(config: &mut Config) -> CliResult {