Skip to content
Myr

Extract entry extension only when there is an extension filter

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Matthias Reitinger · committed by David Peter · parent 83db867 · Browse files · 1 file+5 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−8 removed

  • other:+5 added−8 removed

1 file+5 added−8 removed

modified:src/main.rs+5 added-8 removed
305 unmodified lines
306 },307 }308309 // Filter out unwanted extensions.310 match (&config.extension, entry.path().extension()) {311 (&None, _) => (),312 (&Some(_), None) => return ignore::WalkState::Continue,313 (&Some(ref e1), Some(e2)) => {314 if e1 != &e2.to_string_lossy().to_lowercase() {315 return ignore::WalkState::Continue;316 }317 },310 if let Some(ref filter_ext) = config.extension {311 let entry_ext = entry.path().extension().map(|e| e.to_string_lossy().to_lowercase());312 if entry_ext.map_or(false, |ext| ext != *filter_ext) {313 return ignore::WalkState::Continue;314 }315 }316317 let path_rel_buf = match fshelper::path_relative_from(entry.path(), &*base) {318 Some(p) => p,
207 unmodified lines