diff options
Diffstat (limited to 'cli/bench')
-rw-r--r-- | cli/bench/http.rs | 8 | ||||
-rw-r--r-- | cli/bench/lsp.rs | 6 | ||||
-rw-r--r-- | cli/bench/lsp_bench_standalone.rs | 2 | ||||
-rw-r--r-- | cli/bench/main.rs | 14 |
4 files changed, 15 insertions, 15 deletions
diff --git a/cli/bench/http.rs b/cli/bench/http.rs index 585574e2d..06a177386 100644 --- a/cli/bench/http.rs +++ b/cli/bench/http.rs @@ -44,7 +44,7 @@ pub fn benchmark( let name = entry.file_name().into_string().unwrap(); let file_stem = pathbuf.file_stem().unwrap().to_str().unwrap(); - let lua_script = http_dir.join(format!("{}.lua", file_stem)); + let lua_script = http_dir.join(format!("{file_stem}.lua")); let mut maybe_lua = None; if lua_script.exists() { maybe_lua = Some(lua_script.to_str().unwrap()); @@ -158,7 +158,7 @@ fn run( let wrk = test_util::prebuilt_tool_path("wrk"); assert!(wrk.is_file()); - let addr = format!("http://127.0.0.1:{}/", port); + let addr = format!("http://127.0.0.1:{port}/"); let mut wrk_cmd = vec![wrk.to_str().unwrap(), "-d", DURATION, "--latency", &addr]; @@ -172,7 +172,7 @@ fn run( std::thread::sleep(Duration::from_secs(1)); // wait to capture failure. TODO racy. - println!("{}", output); + println!("{output}"); assert!( server.try_wait()?.map_or(true, |s| s.success()), "server ended with error" @@ -194,7 +194,7 @@ fn get_port() -> u16 { } fn server_addr(port: u16) -> String { - format!("0.0.0.0:{}", port) + format!("0.0.0.0:{port}") } fn core_http_json_ops(exe: &str) -> Result<HttpBenchmarkResult> { diff --git a/cli/bench/lsp.rs b/cli/bench/lsp.rs index fe6fd2703..722a87b69 100644 --- a/cli/bench/lsp.rs +++ b/cli/bench/lsp.rs @@ -202,7 +202,7 @@ fn bench_find_replace(deno_exe: &Path) -> Result<Duration, AnyError> { "textDocument/didOpen", json!({ "textDocument": { - "uri": format!("file:///a/file_{}.ts", i), + "uri": format!("file:///a/file_{i}.ts"), "languageId": "typescript", "version": 1, "text": "console.log(\"000\");\n" @@ -223,7 +223,7 @@ fn bench_find_replace(deno_exe: &Path) -> Result<Duration, AnyError> { } for i in 0..10 { - let file_name = format!("file:///a/file_{}.ts", i); + let file_name = format!("file:///a/file_{i}.ts"); client.write_notification( "textDocument/didChange", lsp::DidChangeTextDocumentParams { @@ -250,7 +250,7 @@ fn bench_find_replace(deno_exe: &Path) -> Result<Duration, AnyError> { } for i in 0..10 { - let file_name = format!("file:///a/file_{}.ts", i); + let file_name = format!("file:///a/file_{i}.ts"); let (maybe_res, maybe_err) = client.write_request::<_, _, Value>( "textDocument/formatting", lsp::DocumentFormattingParams { diff --git a/cli/bench/lsp_bench_standalone.rs b/cli/bench/lsp_bench_standalone.rs index 080f25e73..e8dc29073 100644 --- a/cli/bench/lsp_bench_standalone.rs +++ b/cli/bench/lsp_bench_standalone.rs @@ -55,7 +55,7 @@ fn incremental_change_wait(bench: &mut Bencher) { let mut document_version: u64 = 0; bench.iter(|| { - let text = format!("m{:05}", document_version); + let text = format!("m{document_version:05}"); client .write_notification( "textDocument/didChange", diff --git a/cli/bench/main.rs b/cli/bench/main.rs index e6b9895f2..747407945 100644 --- a/cli/bench/main.rs +++ b/cli/bench/main.rs @@ -189,7 +189,7 @@ fn run_exec_time( let ret_code_test = if let Some(code) = return_code { // Bash test which asserts the return code value of the previous command // $? contains the return code of the previous command - format!("; test $? -eq {}", code) + format!("; test $? -eq {code}") } else { "".to_string() }; @@ -244,11 +244,11 @@ fn rlib_size(target_dir: &std::path::Path, prefix: &str) -> i64 { if name.starts_with(prefix) && name.ends_with(".rlib") { let start = name.split('-').next().unwrap().to_string(); if seen.contains(&start) { - println!("skip {}", name); + println!("skip {name}"); } else { seen.insert(start); size += entry.metadata().unwrap().len(); - println!("check size {} {}", name, size); + println!("check size {name} {size}"); } } } @@ -269,11 +269,11 @@ fn get_binary_sizes(target_dir: &Path) -> Result<HashMap<String, i64>> { // add up size for everything in target/release/deps/libswc* let swc_size = rlib_size(target_dir, "libswc"); - println!("swc {} bytes", swc_size); + println!("swc {swc_size} bytes"); sizes.insert("swc_rlib".to_string(), swc_size); let v8_size = rlib_size(target_dir, "libv8"); - println!("v8 {} bytes", v8_size); + println!("v8 {v8_size} bytes"); sizes.insert("rusty_v8_rlib".to_string(), v8_size); // Because cargo's OUT_DIR is not predictable, search the build tree for @@ -314,7 +314,7 @@ fn bundle_benchmark(deno_exe: &Path) -> Result<HashMap<String, i64>> { let mut sizes = HashMap::<String, i64>::new(); for (name, url) in BUNDLES { - let path = format!("{}.bundle.js", name); + let path = format!("{name}.bundle.js"); test_util::run( &[ deno_exe.to_str().unwrap(), @@ -374,7 +374,7 @@ fn cargo_deps() -> usize { count += 1 } } - println!("cargo_deps {}", count); + println!("cargo_deps {count}"); assert!(count > 10); // Sanity check. count } |