summaryrefslogtreecommitdiff
path: root/cli/tools
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools')
-rw-r--r--cli/tools/bench.rs11
-rw-r--r--cli/tools/test.rs12
2 files changed, 10 insertions, 13 deletions
diff --git a/cli/tools/bench.rs b/cli/tools/bench.rs
index afd20851a..4538aabab 100644
--- a/cli/tools/bench.rs
+++ b/cli/tools/bench.rs
@@ -538,7 +538,7 @@ pub async fn run_benchmarks_with_watch(
let paths_to_watch_clone = paths_to_watch.clone();
let files_changed = changed.is_some();
let bench_options = &bench_options;
- let ps = ps.borrow();
+ let ps = ps.borrow().clone();
async move {
let bench_modules =
@@ -617,7 +617,7 @@ pub async fn run_benchmarks_with_watch(
for path in changed.iter().filter_map(|path| {
deno_core::resolve_url_or_path(&path.to_string_lossy()).ok()
}) {
- if modules.contains(&&path) {
+ if modules.contains(&path) {
modules_to_reload.push((specifier, ModuleKind::Esm));
break;
}
@@ -651,16 +651,15 @@ pub async fn run_benchmarks_with_watch(
let operation = |modules_to_reload: Vec<(ModuleSpecifier, ModuleKind)>| {
let permissions = &permissions;
- ps.borrow_mut().reset_for_file_watcher();
- let ps = ps.borrow();
let bench_options = &bench_options;
+ ps.borrow_mut().reset_for_file_watcher();
+ let ps = ps.borrow().clone();
async move {
let specifiers =
collect_specifiers(&bench_options.files, is_supported_bench_path)?
- .iter()
+ .into_iter()
.filter(|specifier| contains_specifier(&modules_to_reload, specifier))
- .cloned()
.collect::<Vec<ModuleSpecifier>>();
check_specifiers(&ps, permissions.clone(), specifiers.clone()).await?;
diff --git a/cli/tools/test.rs b/cli/tools/test.rs
index 6519a3ca3..56674b976 100644
--- a/cli/tools/test.rs
+++ b/cli/tools/test.rs
@@ -987,7 +987,7 @@ pub async fn check_specifiers(
/// Test a collection of specifiers with test modes concurrently.
async fn test_specifiers(
- ps: ProcState,
+ ps: &ProcState,
permissions: &Permissions,
specifiers_with_mode: Vec<(ModuleSpecifier, TestMode)>,
options: TestSpecifierOptions,
@@ -1328,7 +1328,7 @@ pub async fn run_tests(
}
test_specifiers(
- ps,
+ &ps,
&permissions,
specifiers_with_mode,
TestSpecifierOptions {
@@ -1361,7 +1361,6 @@ pub async fn run_tests_with_watch(
let paths_to_watch_clone = paths_to_watch.clone();
let files_changed = changed.is_some();
let test_options = &test_options;
-
let ps = ps.borrow().clone();
async move {
@@ -1445,7 +1444,7 @@ pub async fn run_tests_with_watch(
for path in changed.iter().filter_map(|path| {
deno_core::resolve_url_or_path(&path.to_string_lossy()).ok()
}) {
- if modules.contains(&&path) {
+ if modules.contains(&path) {
modules_to_reload.push((specifier, ModuleKind::Esm));
break;
}
@@ -1490,11 +1489,10 @@ pub async fn run_tests_with_watch(
&test_options.doc,
)
.await?
- .iter()
+ .into_iter()
.filter(|(specifier, _)| {
contains_specifier(&modules_to_reload, specifier)
})
- .cloned()
.collect::<Vec<(ModuleSpecifier, TestMode)>>();
check_specifiers(&ps, permissions.clone(), specifiers_with_mode.clone())
@@ -1505,7 +1503,7 @@ pub async fn run_tests_with_watch(
}
test_specifiers(
- ps,
+ &ps,
permissions,
specifiers_with_mode,
TestSpecifierOptions {