Skip to content

Commit 3d7de9e

Browse files
committed
fix: false warning
1 parent 2ecfa3d commit 3d7de9e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/app/sub.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,12 @@ where
8181
Threads::Auto => {
8282
// If one of the files is on HDD, set thread number to 1
8383
let disks = Disks::new_with_refreshed_list();
84-
eprintln!("warning: HDD detected, the thread limit will be set to 1");
85-
any_path_is_in_hdd::<hdd::RealApi>(&files, &disks).then_some(1)
84+
if any_path_is_in_hdd::<hdd::RealApi>(&files, &disks) {
85+
eprintln!("warning: HDD detected, the thread limit will be set to 1");
86+
Some(1)
87+
} else {
88+
None
89+
}
8690
}
8791
Threads::Max => None,
8892
Threads::Fixed(threads) => Some(threads),

tests/cli_errors.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ fn fs_errors() {
158158
let expected_stderr_lines = btreeset! {
159159
"[error] read_dir \"./nested/0\": Permission denied (os error 13)",
160160
"[error] read_dir \"./empty-dir\": Permission denied (os error 13)",
161-
"warning: HDD detected, the thread limit will be set to 1", // TODO: fix this bug
162161
};
163162
assert_eq!(actual_stderr_lines, expected_stderr_lines);
164163

0 commit comments

Comments
 (0)