From 4d9c6b28d0a811ed7bd090a95774baf3bfa94c55 Mon Sep 17 00:00:00 2001 From: Johannes Wolf <519002+johannes-wolf@users.noreply.github.com> Date: Thu, 30 Mar 2023 00:36:22 +0200 Subject: cli: Allow reading every path not of type dir (#414) --- tests/src/tests.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/src') 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> { .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) } } -- cgit v1.2.3