فهرست منبع

Simplify compiled file checking code

Ben S 11 سال پیش
والد
کامیت
f12da1ea4c
1فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  1. 4 2
      src/filetype.rs

+ 4 - 2
src/filetype.rs

@@ -126,8 +126,10 @@ impl<'a> HasType for File<'a> {
             if source_files.is_empty() {
                 return Normal;
             }
-            else if source_files.iter().any(|path| self.dir.map(|d| d.contains(path)).unwrap_or(false)) {
-                return Temp;
+            else if let Some(dir) = self.dir {
+                if source_files.iter().any(|path| dir.contains(path)) {
+                    return Temp;
+                }
             }
             else if COMPILED_TYPES.contains(&&ext[..]) {
                 return Compiled;