Skip to content

Commit

Permalink
Fix clippy warning in lib
Browse files Browse the repository at this point in the history
    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
  • Loading branch information
nuxeh committed Nov 22, 2021
1 parent baef137 commit 9441f09
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9441f09

Please sign in to comment.