File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -161,16 +161,15 @@ impl Directories {
161
161
/// - This path is longer than any element in `self.exclude` that is a prefix
162
162
/// of `path`. In case of equality, exclusion wins.
163
163
fn includes_path ( & self , path : & AbsPath ) -> bool {
164
- let include = self . include . iter ( ) . fold ( None :: < & AbsPathBuf > , |include, incl| {
165
- if !path. starts_with ( incl) {
166
- return include;
164
+ let mut include = None :: < & AbsPathBuf > ;
165
+ for incl in & self . include {
166
+ if path. starts_with ( incl) {
167
+ include = Some ( match include {
168
+ Some ( prev) if prev. starts_with ( incl) => prev,
169
+ _ => incl,
170
+ } ) ;
167
171
}
168
-
169
- Some ( match include {
170
- Some ( prev) if prev. starts_with ( incl) => prev,
171
- _ => incl,
172
- } )
173
- } ) ;
172
+ }
174
173
175
174
let include = match include {
176
175
Some ( it) => it,
You can’t perform that action at this time.
0 commit comments