diff options
Diffstat (limited to 'cli/tools')
-rw-r--r-- | cli/tools/coverage/merge.rs | 4 | ||||
-rw-r--r-- | cli/tools/info.rs | 10 | ||||
-rw-r--r-- | cli/tools/installer.rs | 6 | ||||
-rw-r--r-- | cli/tools/vendor/mod.rs | 2 | ||||
-rw-r--r-- | cli/tools/vendor/test.rs | 2 |
5 files changed, 11 insertions, 13 deletions
diff --git a/cli/tools/coverage/merge.rs b/cli/tools/coverage/merge.rs index 63b795f76..d995c6ab3 100644 --- a/cli/tools/coverage/merge.rs +++ b/cli/tools/coverage/merge.rs @@ -73,8 +73,8 @@ pub fn merge_scripts( } let functions: Vec<FunctionCoverage> = range_to_funcs - .into_iter() - .map(|(_, funcs)| merge_functions(funcs).unwrap()) + .into_values() + .map(|funcs| merge_functions(funcs).unwrap()) .collect(); Some(ScriptCoverage { diff --git a/cli/tools/info.rs b/cli/tools/info.rs index 6ab74360b..86a18c4e2 100644 --- a/cli/tools/info.rs +++ b/cli/tools/info.rs @@ -70,7 +70,7 @@ fn print_cache_info( if let Some(location) = &location { origin_dir = - origin_dir.join(&checksum::gen(&[location.to_string().as_bytes()])); + origin_dir.join(checksum::gen(&[location.to_string().as_bytes()])); } let local_storage_dir = origin_dir.join("local_storage"); @@ -526,11 +526,9 @@ impl<'a> GraphDisplayContext<'a> { Specifier(_) => specifier_str, }; let maybe_size = match &package_or_specifier { - Package(package) => self - .npm_info - .package_sizes - .get(&package.id) - .map(|s| *s as u64), + Package(package) => { + self.npm_info.package_sizes.get(&package.id).copied() + } Specifier(_) => module .maybe_source .as_ref() diff --git a/cli/tools/installer.rs b/cli/tools/installer.rs index db49ed7a0..07397131c 100644 --- a/cli/tools/installer.rs +++ b/cli/tools/installer.rs @@ -77,7 +77,7 @@ deno {} "$@" "#, args.join(" "), ); - let mut file = File::create(&shim_data.file_path.with_extension(""))?; + let mut file = File::create(shim_data.file_path.with_extension(""))?; file.write_all(template.as_bytes())?; Ok(()) } @@ -1127,11 +1127,11 @@ mod tests { // create extra files { let file_path = file_path.with_extension("tsconfig.json"); - File::create(&file_path).unwrap(); + File::create(file_path).unwrap(); } { let file_path = file_path.with_extension("lock.json"); - File::create(&file_path).unwrap(); + File::create(file_path).unwrap(); } uninstall("echo_test".to_string(), Some(temp_dir.path().to_path_buf())) diff --git a/cli/tools/vendor/mod.rs b/cli/tools/vendor/mod.rs index 02261e34c..21e3a4485 100644 --- a/cli/tools/vendor/mod.rs +++ b/cli/tools/vendor/mod.rs @@ -120,7 +120,7 @@ fn validate_options( format!("Failed to canonicalize: {}", output_dir.display()) })?; - if import_map_path.starts_with(&output_dir) { + if import_map_path.starts_with(output_dir) { // canonicalize to make the test for this pass on the CI let cwd = canonicalize_path(&std::env::current_dir()?)?; // We don't allow using the output directory to help generate the diff --git a/cli/tools/vendor/test.rs b/cli/tools/vendor/test.rs index c703357d8..9cf2bb603 100644 --- a/cli/tools/vendor/test.rs +++ b/cli/tools/vendor/test.rs @@ -192,7 +192,7 @@ impl VendorTestBuilder { } pub fn new_import_map(&self, base_path: &str) -> ImportMap { - let base = ModuleSpecifier::from_file_path(&make_path(base_path)).unwrap(); + let base = ModuleSpecifier::from_file_path(make_path(base_path)).unwrap(); ImportMap::new(base) } |