From 502ee96c719597aafe060800724c3de5c703ba22 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Mon, 29 Apr 2024 13:15:37 +0200 Subject: [PATCH] clippy: disable the box_default lint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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::::default()` instead of `Box::new(MyType::default())`. I do strongly prefer the latter, and propose to get rid of the lint, as a result. --- .cargo/config.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/.cargo/config.toml b/.cargo/config.toml index 71820b3b89e..6b0882db9ba 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -38,6 +38,7 @@ rustflags = [ "-Wclippy::nonstandard_macro_braces", "-Wclippy::str_to_string", "-Wclippy::todo", + "-Aclippy::box_default" ] [target.'cfg(target_arch = "wasm32")']