From a46191b8bfb69b18a0865b6c7d2b0fabf4011ede Mon Sep 17 00:00:00 2001 From: sharkdp Date: Thu, 1 Oct 2020 20:25:33 +0200 Subject: [PATCH] Remove .unwrap() to prevent crashes --- src/syntax_mapping.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/syntax_mapping.rs b/src/syntax_mapping.rs index 2137d391..55e041d2 100644 --- a/src/syntax_mapping.rs +++ b/src/syntax_mapping.rs @@ -111,8 +111,7 @@ impl<'a> SyntaxMapping<'a> { &git_config_path .join("config") .into_os_string() - .to_str() - .unwrap(), + .to_string_lossy(), MappingTarget::MapTo("Git Config"), ) .unwrap(); @@ -122,8 +121,7 @@ impl<'a> SyntaxMapping<'a> { &git_config_path .join("ignore") .into_os_string() - .to_str() - .unwrap(), + .to_string_lossy(), MappingTarget::MapTo("Git Ignore"), ) .unwrap(); @@ -133,8 +131,7 @@ impl<'a> SyntaxMapping<'a> { &git_config_path .join("attributes") .into_os_string() - .to_str() - .unwrap(), + .to_string_lossy(), MappingTarget::MapTo("Git Attributes"), ) .unwrap();