From 8899677feec72140a9561f813624968cd2e08f09 Mon Sep 17 00:00:00 2001 From: Alexander Lyon Date: Fri, 3 Feb 2023 10:22:51 +0000 Subject: [PATCH] fix outstanding clippy lints (#3601) Two minor issues that clippy complains about. ``` cargo clippy Blocking waiting for file lock on package cache warning: using `write!()` with a format string that ends in a single newline --> crates/turbopack-ecmascript/src/chunk/mod.rs:515:17 | 515 | / write!( 516 | | code, 517 | | "throw new Error({error});\n", 518 | | error = &js_error_message 519 | | )?; | |_________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline = note: `#[warn(clippy::write_with_newline)]` on by default help: use `writeln!` instead | 515 ~ writeln!( 516 | code, 517 ~ "throw new Error({error});", | warning: `turbopack-ecmascript` (lib) generated 1 warning warning: useless conversion to the same type: `turbo_tasks_fs::File` --> crates/turbopack-node/src/render/render_static.rs:128:38 | 128 | FileContent::Content({ File::from(body) }.into()).into(), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `{ File::from(body) }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion = note: `#[warn(clippy::useless_conversion)]` on by default ``` --- crates/turbopack-ecmascript/src/chunk/mod.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/crates/turbopack-ecmascript/src/chunk/mod.rs b/crates/turbopack-ecmascript/src/chunk/mod.rs index b350abeaadc64..a4f789b370a53 100644 --- a/crates/turbopack-ecmascript/src/chunk/mod.rs +++ b/crates/turbopack-ecmascript/src/chunk/mod.rs @@ -512,11 +512,7 @@ impl EcmascriptChunkContentEntryVc { issue.as_issue().emit(); let mut code = CodeBuilder::default(); code += "(() => {{\n\n"; - write!( - code, - "throw new Error({error});\n", - error = &js_error_message - )?; + writeln!(code, "throw new Error({error});", error = &js_error_message)?; code += "\n}})"; code.build().cell() }