From 9441f09c0405c7a5735b6637fc560c4a946eb3ff Mon Sep 17 00:00:00 2001 From: Ed Cragg Date: Mon, 22 Nov 2021 15:48:47 +0000 Subject: [PATCH] Fix clippy warning in lib warning: field assignment outside of initializer for an instance created with Default::default() --> src/lib.rs:81:9 | 81 | ret.parse_cli = true; | ^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(clippy::field_reassign_with_default)]` on by default note: consider initializing the variable with `Aoc { parse_cli: true, ..Default::default() }` and removing relevant reassignments --> src/lib.rs:80:9 | 80 | let mut ret = Self::default(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default --- src/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d3c5c16..bbf17b9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -77,9 +77,7 @@ pub struct Aoc { impl Aoc { pub fn new() -> Self { - let mut ret = Self::default(); - ret.parse_cli = true; - ret + Aoc { parse_cli: true, ..Default::default() } } /// Set the year