From cdea40158916e7f0f3cf2fff80a8a555ba2a6ce7 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Tue, 27 Aug 2019 02:47:34 +0800 Subject: [PATCH] refactor: just match enum (#236) Remove forced unwrap since match is already exhausted --- src/init.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/init.rs b/src/init.rs index 398538f7..fed4be2f 100644 --- a/src/init.rs +++ b/src/init.rs @@ -63,15 +63,13 @@ pub fn init_stub(shell_name: &str) -> io::Result<()> { ); None } - _ => { - /* Calling unwrap() here is fine because the None case will have - already matched on the previous arm */ + Some(shell_basename) => { println!( "printf \"\\n{0} is not yet supported by starship.\\n\ For the time being, we support bash, zsh, and fish.\\n\ Please open an issue in the starship repo if you would like to \ see support for {0}:\\nhttps://github.com/starship/starship/issues/new\"\\n\\n", - shell_basename.unwrap() + shell_basename ); None }