diff options
author | Ben S <ogham@bsago.me> | 2015-03-07 23:51:13 +0000 |
---|---|---|
committer | Ben S <ogham@bsago.me> | 2015-03-07 23:51:13 +0000 |
commit | f12da1ea4c7e8911172717de3424a8ab28aae16f (patch) | |
tree | 9a23b63fe9d49a0847013f70ca3fb7bd4e6b99da /src/filetype.rs | |
parent | 3e7357819b3bb24619c1a600aa5cb927cd586459 (diff) |
Simplify compiled file checking code
Diffstat (limited to 'src/filetype.rs')
-rw-r--r-- | src/filetype.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/filetype.rs b/src/filetype.rs index f116fb8..074b292 100644 --- a/src/filetype.rs +++ b/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; |