Improve iterator usage

This commit is contained in:
Marcin Puc authored and Martin Nordholts committed 2021-09-12 15:50:10 +02:00
1 parent 372e42f350
commit 7956485e37
5 files changed
+10 -13

No files matched your search

+1 -1
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;