diff options
Diffstat (limited to 'cli/tools/fmt.rs')
-rw-r--r-- | cli/tools/fmt.rs | 14 |
1 files changed, 7 insertions, 7 deletions
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()) } } |