From a90e095076dc32a4a0e133aee84d611c23d61e10 Mon Sep 17 00:00:00 2001 From: Shehzad <55528726+ShehzadAhm@users.noreply.github.com> Date: Fri, 4 Oct 2024 21:26:40 +0530 Subject: [PATCH] fix(lint): fix lint error `error: match can be simplified with .unwrap_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> --- src/usecase/fzf_make/app.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/usecase/fzf_make/app.rs b/src/usecase/fzf_make/app.rs index fc9cd07d..dc430a88 100644 --- a/src/usecase/fzf_make/app.rs +++ b/src/usecase/fzf_make/app.rs @@ -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) })