Skip to content
Myr

Do not include non-files when using --size

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

authored by sharkdp · committed by David Peter · parent 0bbc7f5 · Browse files · 1 file+14 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+14 added−8 removed

  • other:+14 added−8 removed

1 file+14 added−8 removed

modified:src/walk.rs+14 added-8 removed
247 unmodified lines
248 }249 }250251 // Filter out unwanted sizes if it is a file and we have been given size constraints.252 if config.size_constraints.len() > 0 {252 if config.size_constraints.len() > 0 && entry_path.is_file() {253 if let Ok(metadata) = entry_path.metadata() {254 let file_size = metadata.len();255 if config256 .size_constraints257 .iter()258 .any(|sc| !sc.is_within(file_size))259 {253 if entry_path.is_file() {254 if let Ok(metadata) = entry_path.metadata() {255 let file_size = metadata.len();256 if config257 .size_constraints258 .iter()259 .any(|sc| !sc.is_within(file_size))260 {261 return ignore::WalkState::Continue;262 }263 } else {264 return ignore::WalkState::Continue;265 }266 } else {267 return ignore::WalkState::Continue;268 }269 }270271 let search_str_o = if config.search_full_path {
30 unmodified lines