summaryrefslogtreecommitdiff
path: root/cli/bench/lsp.rs
diff options
context:
space:
mode:
authorYusuke Tanaka <yusuktan@maguro.dev>2021-03-26 03:17:37 +0900
committerGitHub <noreply@github.com>2021-03-25 19:17:37 +0100
commite7954413e16d5814db5da6389f8d6e0c328812aa (patch)
tree2840a275019df3e193c7c2f84442740ce7b7e48e /cli/bench/lsp.rs
parent881e1e8164f1661158bac24f7ec03b969a0a8a02 (diff)
upgrade: Rust 1.51.0 (#9895)
Diffstat (limited to 'cli/bench/lsp.rs')
-rw-r--r--cli/bench/lsp.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/bench/lsp.rs b/cli/bench/lsp.rs
index 63e1821d4..da02db486 100644
--- a/cli/bench/lsp.rs
+++ b/cli/bench/lsp.rs
@@ -14,7 +14,7 @@ use std::collections::HashMap;
use std::io::BufRead;
use std::io::Read;
use std::io::Write;
-use std::path::PathBuf;
+use std::path::Path;
use std::process::ChildStdin;
use std::process::ChildStdout;
use std::process::Command;
@@ -135,7 +135,7 @@ impl Drop for LspClient {
}
impl LspClient {
- fn new(deno_exe: &PathBuf) -> Result<Self, AnyError> {
+ fn new(deno_exe: &Path) -> Result<Self, AnyError> {
let mut child = Command::new(deno_exe)
.arg("lsp")
.stdin(Stdio::piped())
@@ -244,7 +244,7 @@ impl LspClient {
/// A benchmark that opens a 8000+ line TypeScript document, adds a function to
/// the end of the document and does a level of hovering and gets quick fix
/// code actions.
-fn bench_big_file_edits(deno_exe: &PathBuf) -> Result<Duration, AnyError> {
+fn bench_big_file_edits(deno_exe: &Path) -> Result<Duration, AnyError> {
let mut client = LspClient::new(deno_exe)?;
let params: Value = serde_json::from_slice(FIXTURE_INIT_JSON)?;
@@ -302,7 +302,7 @@ fn bench_big_file_edits(deno_exe: &PathBuf) -> Result<Duration, AnyError> {
}
/// A test that starts up the LSP, opens a single line document, and exits.
-fn bench_startup_shutdown(deno_exe: &PathBuf) -> Result<Duration, AnyError> {
+fn bench_startup_shutdown(deno_exe: &Path) -> Result<Duration, AnyError> {
let mut client = LspClient::new(deno_exe)?;
let params: Value = serde_json::from_slice(FIXTURE_INIT_JSON)?;
@@ -338,7 +338,7 @@ fn bench_startup_shutdown(deno_exe: &PathBuf) -> Result<Duration, AnyError> {
/// Generate benchmarks for the LSP server.
pub(crate) fn benchmarks(
- deno_exe: &PathBuf,
+ deno_exe: &Path,
) -> Result<HashMap<String, u64>, AnyError> {
println!("-> Start benchmarking lsp");
let mut exec_times = HashMap::new();