Skip to content

Commit

Permalink
fix(lint): fix lint error `error: match can be simplified with .unwra…
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
ShehzadAhm and kyu08 authored Oct 4, 2024
1 parent 68f8de1 commit a90e095
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/usecase/fzf_make/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,8 @@ impl Model<'_> {
Err(_) => return Histories::new(makefile_path, vec![]), // NOTE: Show error message on message pane https://github.com/kyu08/fzf-make/issues/152
Ok(c) => c,
};
let histories = match toml::parse_history(content.to_string()) {
Err(_) => vec![], // NOTE: Show error message on message pane https://github.com/kyu08/fzf-make/issues/152
Ok(h) => h,
};
// TODO: Show error message on message pane if parsing history file failed. https://github.com/kyu08/fzf-make/issues/152
let histories = toml::parse_history(content.to_string()).unwrap_or_default();

Histories::new(makefile_path, histories)
})
Expand Down

0 comments on commit a90e095

Please sign in to comment.