summaryrefslogtreecommitdiff
path: root/cli/bench/http.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-06-10 11:09:45 -0400
committerGitHub <noreply@github.com>2023-06-10 11:09:45 -0400
commit7f15126f23d97f20a4fb33e43136cd4d13825863 (patch)
tree85d77389969b31999680059e65954a9fa863758e /cli/bench/http.rs
parentf3326eebd6af2aaca1543e8cb543a7b16762bc96 (diff)
chore(tests): test_util - Add `PathRef` (#19450)
This adds a new `PathRef` struct to test_util for making it easier to work with paths in test code. I'm going to expand on this more in the future.
Diffstat (limited to 'cli/bench/http.rs')
-rw-r--r--cli/bench/http.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/bench/http.rs b/cli/bench/http.rs
index 031e9801c..909c4937c 100644
--- a/cli/bench/http.rs
+++ b/cli/bench/http.rs
@@ -23,7 +23,7 @@ pub fn benchmark(
target_path: &Path,
) -> Result<HashMap<String, HttpBenchmarkResult>> {
let deno_exe = test_util::deno_exe_path();
- let deno_exe = deno_exe.to_str().unwrap();
+ let deno_exe = deno_exe.to_string();
let hyper_hello_exe = target_path.join("test_server");
let hyper_hello_exe = hyper_hello_exe.to_str().unwrap();
@@ -82,7 +82,7 @@ pub fn benchmark(
res.insert(
file_stem.to_string(),
run(
- &[bun_exe.to_str().unwrap(), path, &port.to_string()],
+ &[&bun_exe.to_string(), path, &port.to_string()],
port,
None,
None,
@@ -95,7 +95,7 @@ pub fn benchmark(
file_stem.to_string(),
run(
&[
- deno_exe,
+ deno_exe.as_str(),
"run",
"--allow-all",
"--unstable",
@@ -160,8 +160,8 @@ fn run(
assert!(wrk.is_file());
let addr = format!("http://127.0.0.1:{port}/");
- let mut wrk_cmd =
- vec![wrk.to_str().unwrap(), "-d", DURATION, "--latency", &addr];
+ let wrk = wrk.to_string();
+ let mut wrk_cmd = vec![wrk.as_str(), "-d", DURATION, "--latency", &addr];
if let Some(lua_script) = lua_script {
wrk_cmd.push("-s");