diff options
Diffstat (limited to 'tests/src')
| -rw-r--r-- | tests/src/tests.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/src/tests.rs b/tests/src/tests.rs index 66eb532f..fef8c0cf 100644 --- a/tests/src/tests.rs +++ b/tests/src/tests.rs @@ -324,10 +324,10 @@ fn read(path: &Path) -> FileResult<Vec<u8>> { .unwrap_or_else(|_| path.into()); let f = |e| FileError::from_io(e, &suffix); - if fs::metadata(&path).map_err(f)?.is_file() { - fs::read(&path).map_err(f) - } else { + if fs::metadata(&path).map_err(f)?.is_dir() { Err(FileError::IsDirectory) + } else { + fs::read(&path).map_err(f) } } |
