Chore: prefer HashMap::from over collecting Vec of tuples

This commit is contained in:
Basti Ortiz 2021-10-29 16:26:36 +08:00
parent 0a98b1de5c
commit 144d94178a
No known key found for this signature in database
GPG Key ID: 1402D5CB17F48E1B

View File

@ -15,10 +15,10 @@ lazy_static::lazy_static! {
// Maps from commonly known external commands (not builtin to cargo) to their // Maps from commonly known external commands (not builtin to cargo) to their
// description, for the help page. Reserved for external subcommands that are // 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). // 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."), ("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."), ("fmt", "Formats all bin and lib files of the current crate using rustfmt."),
].into_iter().collect(); ]);
} }
pub fn main(config: &mut Config) -> CliResult { pub fn main(config: &mut Config) -> CliResult {