Skip to content

Commit

Permalink
clippy: disable the box_default lint
Browse files Browse the repository at this point in the history
The clippy website explains that `Box::new(Default::default())` can be
shortened to `Box::default()` and that it's more readable. That's true…
when you don't have a generic parameter in the mix (which may be
required if rustc can't infer the type of the boxee), in which case it
just looks bad, e.g. `Box::<MyType>::default()` instead of
`Box::new(MyType::default())`.

I do strongly prefer the latter, and propose to get rid of the lint, as
a result.
  • Loading branch information
bnjbvr committed Apr 29, 2024
1 parent 4618d7c commit 16eb449
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ rustflags = [
"-Wclippy::nonstandard_macro_braces",
"-Wclippy::str_to_string",
"-Wclippy::todo",
"-Aclippy::box_default"
]

[target.'cfg(target_arch = "wasm32")']
Expand Down

0 comments on commit 16eb449

Please sign in to comment.