Skip to content

Commit

Permalink
fix outstanding clippy lints (#3601)
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
arlyon authored Feb 3, 2023
1 parent bfe30df commit 8899677
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions crates/turbopack-ecmascript/src/chunk/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit 8899677

Please sign in to comment.