1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-08 14:22:25 +01:00

Improve iterator usage

This commit is contained in:
Marcin Puc
2021-09-10 21:56:40 +02:00
committed by Martin Nordholts
parent 372e42f350
commit 7956485e37
5 changed files with 10 additions and 13 deletions

View File

@@ -351,7 +351,7 @@ impl HighlightingAssets {
let file_path = Path::new(file_name);
let mut syntax = None;
if let Some(file_str) = file_path.to_str() {
for suffix in IGNORED_SUFFIXES.iter() {
for suffix in &IGNORED_SUFFIXES {
if let Some(stripped_filename) = file_str.strip_suffix(suffix) {
syntax = self.get_extension_syntax(OsStr::new(stripped_filename))?;
break;