From fe1149592058c6206a037d962a6d071d5aa1d7c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 10 Jun 2021 16:18:13 +0200 Subject: [PATCH] refactor: use join instead of format! (#10921) --- cli/main.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cli/main.rs b/cli/main.rs index 5827203ce3..3354f4399e 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -329,8 +329,7 @@ fn print_cache_info( } pub fn get_types(unstable: bool) -> String { - let mut types = format!( - "{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}", + let mut types = vec![ crate::tsc::DENO_NS_LIB, crate::tsc::DENO_CONSOLE_LIB, crate::tsc::DENO_URL_LIB, @@ -343,13 +342,13 @@ pub fn get_types(unstable: bool) -> String { crate::tsc::DENO_BROADCAST_CHANNEL_LIB, crate::tsc::SHARED_GLOBALS_LIB, crate::tsc::WINDOW_LIB, - ); + ]; if unstable { - types.push_str(&format!("\n{}", crate::tsc::UNSTABLE_NS_LIB,)); + types.push(crate::tsc::UNSTABLE_NS_LIB); } - types + types.join("\n") } async fn compile_command(