mirror of
https://github.com/sharkdp/bat.git
synced 2025-03-02 00:38:22 +00:00
Use 'if let' instead of 'match'
This commit is contained in:
parent
9e2ea5fdd4
commit
ec2722d465
@ -91,12 +91,9 @@ pub fn list_languages(config: &Config) -> Result<()> {
|
|||||||
let configured_languages = get_syntax_mapping_to_paths(config.syntax_mapping.mappings());
|
let configured_languages = get_syntax_mapping_to_paths(config.syntax_mapping.mappings());
|
||||||
|
|
||||||
for lang in languages.iter_mut() {
|
for lang in languages.iter_mut() {
|
||||||
match configured_languages.get(&lang.name) {
|
if let Some(additional_paths) = configured_languages.get(&lang.name) {
|
||||||
Some(additional_paths) => {
|
lang.file_extensions
|
||||||
lang.file_extensions
|
.extend(additional_paths.iter().cloned());
|
||||||
.extend(additional_paths.iter().cloned());
|
|
||||||
}
|
|
||||||
None => {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user