diff options
author | sharkdp <davidpeter@web.de> | 2020-06-03 09:44:13 +0200 |
---|---|---|
committer | David Peter <sharkdp@users.noreply.github.com> | 2020-06-03 19:44:41 +0200 |
commit | ec2722d46520c0fd8fe28b17a788dea5b5e4b7c3 (patch) | |
tree | 48bcfad90d993a5614370c99189fe338e13ae25a /src | |
parent | 9e2ea5fdd43d90b4c8cecd8e1f0354fabdbe344c (diff) |
Use 'if let' instead of 'match'
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/bat/main.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/bin/bat/main.rs b/src/bin/bat/main.rs index 818b64d2..1210f169 100644 --- a/src/bin/bat/main.rs +++ b/src/bin/bat/main.rs @@ -91,12 +91,9 @@ pub fn list_languages(config: &Config) -> Result<()> { let configured_languages = get_syntax_mapping_to_paths(config.syntax_mapping.mappings()); for lang in languages.iter_mut() { - match configured_languages.get(&lang.name) { - Some(additional_paths) => { - lang.file_extensions - .extend(additional_paths.iter().cloned()); - } - None => {} + if let Some(additional_paths) = configured_languages.get(&lang.name) { + lang.file_extensions + .extend(additional_paths.iter().cloned()); } } |