summaryrefslogtreecommitdiff
path: root/cli/tools
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools')
-rw-r--r--cli/tools/coverage.rs2
-rw-r--r--cli/tools/fmt.rs14
-rw-r--r--cli/tools/lint.rs2
-rw-r--r--cli/tools/repl.rs4
-rw-r--r--cli/tools/test_runner.rs12
5 files changed, 17 insertions, 17 deletions
diff --git a/cli/tools/coverage.rs b/cli/tools/coverage.rs
index b7772f310..bb1e9417d 100644
--- a/cli/tools/coverage.rs
+++ b/cli/tools/coverage.rs
@@ -709,7 +709,7 @@ pub async fn cover_files(
reporter.visit_coverage(
&script_coverage,
- &script_source,
+ script_source,
maybe_source_map,
maybe_cached_source,
);
diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs
index ac9af0292..a02b86b17 100644
--- a/cli/tools/fmt.rs
+++ b/cli/tools/fmt.rs
@@ -99,7 +99,7 @@ fn format_markdown(
) -> Result<String, String> {
let md_config = get_markdown_config();
dprint_plugin_markdown::format_text(
- &file_text,
+ file_text,
&md_config,
move |tag, text, line_width| {
let tag = tag.to_lowercase();
@@ -125,7 +125,7 @@ fn format_markdown(
if matches!(extension, "json" | "jsonc") {
let mut json_config = get_json_config();
json_config.line_width = line_width;
- dprint_plugin_json::format_text(&text, &json_config)
+ dprint_plugin_json::format_text(text, &json_config)
} else {
let fake_filename =
PathBuf::from(format!("deno_fmt_stdin.{}", extension));
@@ -133,7 +133,7 @@ fn format_markdown(
codeblock_config.line_width = line_width;
dprint_plugin_typescript::format_text(
&fake_filename,
- &text,
+ text,
&codeblock_config,
)
}
@@ -150,7 +150,7 @@ fn format_markdown(
/// See https://git.io/Jt4ht for configuration.
fn format_json(file_text: &str) -> Result<String, String> {
let json_config = get_json_config();
- dprint_plugin_json::format_text(&file_text, &json_config)
+ dprint_plugin_json::format_text(file_text, &json_config)
.map_err(|e| e.to_string())
}
@@ -162,11 +162,11 @@ pub fn format_file(
) -> Result<String, String> {
let ext = get_extension(file_path).unwrap_or_else(String::new);
if ext == "md" {
- format_markdown(&file_text, config)
+ format_markdown(file_text, config)
} else if matches!(ext.as_str(), "json" | "jsonc") {
- format_json(&file_text)
+ format_json(file_text)
} else {
- dprint_plugin_typescript::format_text(&file_path, &file_text, &config)
+ dprint_plugin_typescript::format_text(file_path, file_text, &config)
.map_err(|e| e.to_string())
}
}
diff --git a/cli/tools/lint.rs b/cli/tools/lint.rs
index 0b0479a04..967eec2ad 100644
--- a/cli/tools/lint.rs
+++ b/cli/tools/lint.rs
@@ -81,7 +81,7 @@ pub async fn lint_files(
sort_diagnostics(&mut file_diagnostics);
for d in file_diagnostics.iter() {
has_error.store(true, Ordering::Relaxed);
- reporter.visit_diagnostic(&d, source.split('\n').collect());
+ reporter.visit_diagnostic(d, source.split('\n').collect());
}
}
Err(err) => {
diff --git a/cli/tools/repl.rs b/cli/tools/repl.rs
index b86e8ccd8..5b0d78841 100644
--- a/cli/tools/repl.rs
+++ b/cli/tools/repl.rs
@@ -555,7 +555,7 @@ impl ReplSession {
if evaluate_response.get("exceptionDetails").is_some()
&& wrapped_line != line
{
- self.evaluate_ts_expression(&line).await?
+ self.evaluate_ts_expression(line).await?
} else {
evaluate_response
};
@@ -632,7 +632,7 @@ impl ReplSession {
expression: &str,
) -> Result<Value, AnyError> {
let parsed_module =
- crate::ast::parse("repl.ts", &expression, &crate::MediaType::TypeScript)?;
+ crate::ast::parse("repl.ts", expression, &crate::MediaType::TypeScript)?;
let transpiled_src = parsed_module
.transpile(&crate::ast::EmitOptions {
diff --git a/cli/tools/test_runner.rs b/cli/tools/test_runner.rs
index a9610015e..656db50f4 100644
--- a/cli/tools/test_runner.rs
+++ b/cli/tools/test_runner.rs
@@ -355,7 +355,7 @@ fn extract_files_from_regex_blocks(
lines_regex: &Regex,
) -> Result<Vec<File>, AnyError> {
let files = blocks_regex
- .captures_iter(&source)
+ .captures_iter(source)
.filter_map(|block| {
let maybe_attributes = block
.get(1)
@@ -390,7 +390,7 @@ fn extract_files_from_regex_blocks(
// TODO(caspervonb) generate an inline source map
let mut file_source = String::new();
- for line in lines_regex.captures_iter(&text) {
+ for line in lines_regex.captures_iter(text) {
let text = line.get(1).unwrap();
file_source.push_str(&format!("{}\n", text.as_str()));
}
@@ -424,7 +424,7 @@ fn extract_files_from_source_comments(
source: &str,
media_type: &MediaType,
) -> Result<Vec<File>, AnyError> {
- let parsed_module = ast::parse(&specifier.as_str(), &source, &media_type)?;
+ let parsed_module = ast::parse(specifier.as_str(), source, media_type)?;
let mut comments = parsed_module.get_comments();
comments
.sort_by_key(|comment| parsed_module.get_location(&comment.span).line);
@@ -447,7 +447,7 @@ fn extract_files_from_source_comments(
extract_files_from_regex_blocks(
&location,
&comment.text,
- &media_type,
+ media_type,
&blocks_regex,
&lines_regex,
)
@@ -474,8 +474,8 @@ fn extract_files_from_fenced_blocks(
extract_files_from_regex_blocks(
&location,
- &source,
- &media_type,
+ source,
+ media_type,
&blocks_regex,
&lines_regex,
)