From 205fd1abddde2580fdeaf4b358a44818227670cb Mon Sep 17 00:00:00 2001 From: David Knaack Date: Wed, 14 Oct 2020 18:13:08 +0200 Subject: [PATCH] fix(git_state): remove unwrap in `describe_rebase` (#1761) --- src/modules/git_state.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/git_state.rs b/src/modules/git_state.rs index a7bfaf4f..59ba36a6 100644 --- a/src/modules/git_state.rs +++ b/src/modules/git_state.rs @@ -135,18 +135,17 @@ fn describe_rebase<'a>(root: &'a PathBuf, rebase_config: &'a str) -> StateDescri let progress = if has_path("rebase-merge/msgnum") { paths_to_progress("rebase-merge/msgnum", "rebase-merge/end") - } else if has_path("rebase-merge/onto") { - Some((1, 1)) } else if has_path("rebase-apply") { paths_to_progress("rebase-apply/next", "rebase-apply/last") } else { None }; + let progress = progress.unwrap_or((1, 1)); StateDescription { label: rebase_config, - current: Some(format!("{}", progress.unwrap().0)), - total: Some(format!("{}", progress.unwrap().1)), + current: Some(format!("{}", progress.0)), + total: Some(format!("{}", progress.1)), } }