diff options
author | Kienyew <aobi100bt@hotmail.com> | 2020-09-06 23:04:51 +0800 |
---|---|---|
committer | David Peter <sharkdp@users.noreply.github.com> | 2020-09-20 12:14:21 +0200 |
commit | 83c775065657dfc5bbaa83060f073a83d7fec911 (patch) | |
tree | b61941f4c15c7b5561c11949324b6db9d1bd2c94 /src | |
parent | c477e23fe9c8c0d677f8ed2b2b94c81262a48cc6 (diff) |
Use unwrap
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/bat/main.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/bin/bat/main.rs b/src/bin/bat/main.rs index 1fd43b85..a5b6f4f9 100644 --- a/src/bin/bat/main.rs +++ b/src/bin/bat/main.rs @@ -100,11 +100,8 @@ pub fn list_languages(config: &Config) -> Result<()> { true } else { let test_file = Path::new("test").with_extension(extension); - if let Some(syntax) = assets.syntax_for_file_name(test_file, &config.syntax_mapping) { - syntax.name == lang_name - } else { - false - } + let syntax = assets.syntax_for_file_name(test_file, &config.syntax_mapping).unwrap(); + syntax.name == lang_name } }); } |