diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-03-23 23:27:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-23 23:27:58 +0100 |
commit | 275dee60e71225a9c6c4b3b4ea7ffe4c6ecb4d87 (patch) | |
tree | 13ed3ab7e825a81085e8dcc5efeee417416b86cf /cli/args/flags.rs | |
parent | edab8f2fd48efddc19eb0032955fee4b5dbf76e6 (diff) |
refactor: make version and user_agent &'static str (#18400)
These caused a bunch of unnecessary allocations on each startup.
Diffstat (limited to 'cli/args/flags.rs')
-rw-r--r-- | cli/args/flags.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 236352f24..e85938822 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -641,7 +641,7 @@ To evaluate code in the shell: /// Main entry point for parsing deno's command line flags. pub fn flags_from_vec(args: Vec<String>) -> clap::Result<Flags> { let version = crate::version::deno(); - let mut app = clap_root(&version); + let mut app = clap_root(version); let matches = app.try_get_matches_from_mut(&args)?; let mut flags = Flags::default(); @@ -712,7 +712,7 @@ fn handle_repl_flags(flags: &mut Flags, repl_flags: ReplFlags) { flags.subcommand = DenoSubcommand::Repl(repl_flags); } -fn clap_root(version: &str) -> Command { +fn clap_root(version: &'static str) -> Command { clap::Command::new("deno") .bin_name("deno") .color(ColorChoice::Never) |