Skip to content

Commit

Permalink
Fix clippy lint for unwrap_or_default
Browse files Browse the repository at this point in the history
Latest nightly clippy warns:

    warning: use of `unwrap_or_else` to construct default value
      --> inquire/src/prompts/multiselect/prompt.rs:67:14
       |
    67 |             .unwrap_or_else(BTreeSet::new);
       |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
       = note: `#[warn(clippy::unwrap_or_default)]` on by default
  • Loading branch information
jasonish committed Oct 11, 2023
1 parent ce308d1 commit a243061
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inquire/src/prompts/multiselect/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ where
.filter(|i| *i < mso.options.len())
.collect()
})
.unwrap_or_else(BTreeSet::new);
.unwrap_or_default();

Ok(Self {
message: mso.message,
Expand Down

0 comments on commit a243061

Please sign in to comment.