2
0
mirror of https://github.com/sharkdp/bat synced 2024-11-16 21:25:56 +00:00

Use unwrap

This commit is contained in:
Kienyew 2020-09-06 23:04:51 +08:00 committed by David Peter
parent c477e23fe9
commit 83c7750656

View File

@ -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
}
});
}