summaryrefslogtreecommitdiff
path: root/cli/tools/bench.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools/bench.rs')
-rw-r--r--cli/tools/bench.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/cli/tools/bench.rs b/cli/tools/bench.rs
index 419ac2da6..18ac63f38 100644
--- a/cli/tools/bench.rs
+++ b/cli/tools/bench.rs
@@ -30,7 +30,6 @@ use indexmap::IndexMap;
use log::Level;
use serde::Deserialize;
use serde::Serialize;
-use std::cell::RefCell;
use std::collections::HashSet;
use std::path::Path;
use std::path::PathBuf;
@@ -338,6 +337,7 @@ async fn check_specifiers(
lib,
PermissionsContainer::allow_all(),
PermissionsContainer::new(permissions),
+ true,
)
.await?;
@@ -529,14 +529,12 @@ pub async fn run_benchmarks_with_watch(
Permissions::from_options(&ps.options.permissions_options())?;
let no_check = ps.options.type_check_mode() == TypeCheckMode::None;
- let ps = RefCell::new(ps);
-
let resolver = |changed: Option<Vec<PathBuf>>| {
let paths_to_watch = bench_options.files.include.clone();
let paths_to_watch_clone = paths_to_watch.clone();
let files_changed = changed.is_some();
let bench_options = &bench_options;
- let ps = ps.borrow().clone();
+ let ps = ps.clone();
async move {
let bench_modules =
@@ -640,8 +638,7 @@ pub async fn run_benchmarks_with_watch(
let operation = |modules_to_reload: Vec<ModuleSpecifier>| {
let permissions = &permissions;
let bench_options = &bench_options;
- ps.borrow_mut().reset_for_file_watcher();
- let ps = ps.borrow().clone();
+ let ps = ps.clone();
async move {
let specifiers =
@@ -666,13 +663,12 @@ pub async fn run_benchmarks_with_watch(
}
};
- let clear_screen = !ps.borrow().options.no_clear_screen();
file_watcher::watch_func(
resolver,
operation,
file_watcher::PrintConfig {
job_name: "Bench".to_string(),
- clear_screen,
+ clear_screen: !ps.options.no_clear_screen(),
},
)
.await?;