Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint error error: match can be simplified with .unwrap_or_default() #312

Closed
kyu08 opened this issue Oct 2, 2024 · 2 comments · Fixed by #313
Closed

Fix lint error error: match can be simplified with .unwrap_or_default() #312

kyu08 opened this issue Oct 2, 2024 · 2 comments · Fixed by #313
Assignees

Comments

@kyu08
Copy link
Owner

kyu08 commented Oct 2, 2024

Log: https://github.com/kyu08/fzf-make/actions/runs/11116983390/job/30888165438

error: match can be simplified with `.unwrap_or_default()`
  --> src/usecase/fzf_make/app.rs:89:29
   |
89 |               let histories = match toml::parse_history(content.to_string()) {
   |  _____________________________^
90 | |                 Err(_) => vec![], // NOTE: Show error message on message pane https://github.com/kyu08/fzf-make/issues/152
91 | |                 Ok(h) => h,
92 | |             };
   | |_____________^ help: replace it with: `toml::parse_history(content.to_string()).unwrap_or_default()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default
   = note: `-D clippy::manual-unwrap-or-default` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::manual_unwrap_or_default)]`

error: could not compile `fzf-make` (bin "fzf-make") due to 1 previous error
@kyu08 kyu08 changed the title Fix lint error Fix lint error error: match can be simplified with .unwrap_or_default()`` Oct 2, 2024
@kyu08 kyu08 changed the title Fix lint error error: match can be simplified with .unwrap_or_default()`` Fix lint error error: match can be simplified with .unwrap_or_default()` Oct 2, 2024
@kyu08 kyu08 changed the title Fix lint error error: match can be simplified with .unwrap_or_default()` Fix lint error error: match can be simplified with .unwrap_or_default()`` Oct 2, 2024
@kyu08 kyu08 changed the title Fix lint error error: match can be simplified with .unwrap_or_default()`` Fix lint error error: match can be simplified with .unwrap_or_default() Oct 2, 2024
@kyu08 kyu08 added the good first issue Good for newcomers label Oct 2, 2024
@ShehzadAhm
Copy link
Contributor

I can work on this issue

@kyu08
Copy link
Owner Author

kyu08 commented Oct 2, 2024

@ShehzadAhm
Thank you for working on this and send a PR!
I will review your PR within few days.

kyu08 added a commit that referenced this issue Oct 4, 2024
…p_or_default()` #312 (#313)

* Fix lint error

* fix: use `unwrap_or_default` instead of `unwrap_or_else`

---------

Co-authored-by: kyu08 <49891479+kyu08@users.noreply.github.com>
@kyu08 kyu08 closed this as completed in #313 Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants