diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-08-15 22:47:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-15 23:47:16 +0200 |
commit | 2bb013f9baa927fc7b392766b0182b91380b9aa8 (patch) | |
tree | ca8a7ea961b50213adf0904d724974c317cefb55 /cli/tools/bench | |
parent | 5ec3c5c3a46ca95f355a4520676b85ac619ca102 (diff) |
refactor: `version` module exports a single const struct (#25014)
This commit rewrites the internal `version` module that exported
various information about the current executable. Instead of exporting
several consts, we are now exporting a single const structure that
contains all the necessary information.
This is the first step towards cleaning up how we use this information
and should allow us to use SUI to be able to patch this information
in already produced binary making it easier to cut new releases.
---------
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Diffstat (limited to 'cli/tools/bench')
-rw-r--r-- | cli/tools/bench/mod.rs | 1 | ||||
-rw-r--r-- | cli/tools/bench/reporters.rs | 10 |
2 files changed, 8 insertions, 3 deletions
diff --git a/cli/tools/bench/mod.rs b/cli/tools/bench/mod.rs index 9cf222c45..44ae8321d 100644 --- a/cli/tools/bench/mod.rs +++ b/cli/tools/bench/mod.rs @@ -13,7 +13,6 @@ use crate::util::file_watcher; use crate::util::fs::collect_specifiers; use crate::util::path::is_script_ext; use crate::util::path::matches_pattern_or_exact_path; -use crate::version::get_user_agent; use crate::worker::CliMainWorkerFactory; use deno_config::glob::WalkEntry; diff --git a/cli/tools/bench/reporters.rs b/cli/tools/bench/reporters.rs index 690373dc8..9a1da04ec 100644 --- a/cli/tools/bench/reporters.rs +++ b/cli/tools/bench/reporters.rs @@ -2,6 +2,8 @@ use serde::Serialize; +use crate::version; + use super::*; pub trait BenchReporter { @@ -25,7 +27,11 @@ struct JsonReporterOutput { impl Default for JsonReporterOutput { fn default() -> Self { Self { - runtime: format!("{} {}", get_user_agent(), env!("TARGET")), + runtime: format!( + "{} {}", + version::DENO_VERSION_INFO.user_agent, + env!("TARGET") + ), cpu: mitata::cpu::name(), benches: vec![], } @@ -150,7 +156,7 @@ impl BenchReporter for ConsoleReporter { "{}\n", colors::gray(format!( "runtime: deno {} ({})", - crate::version::deno(), + crate::version::DENO_VERSION_INFO.deno, env!("TARGET") )) ); |