Skip to content

Commit 7f3d0f5

Browse files
committed
fs: remove unused lambda capture in CpSyncCopyDir
file_copy_opts was left over from the std::filesystem::copy_file path and is no longer read now that regular-file copies go through uv_fs_copyfile. Clang treats the stale capture as an error under -Werror,-Wunused-lambda-capture. Signed-off-by: Jeremy Schoemaker <jeremy@shoemoney.com>
1 parent 221cfd9 commit 7f3d0f5

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

‎src/node_file.cc‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4082,21 +4082,11 @@ static void CpSyncCopyDir(const FunctionCallbackInfo<Value>& args) {
40824082
return env->ThrowStdErrException(error, "cp", *dest);
40834083
}
40844084

4085-
auto file_copy_opts = std::filesystem::copy_options::recursive;
4086-
if (force) {
4087-
file_copy_opts |= std::filesystem::copy_options::overwrite_existing;
4088-
} else if (error_on_exist) {
4089-
file_copy_opts |= std::filesystem::copy_options::none;
4090-
} else {
4091-
file_copy_opts |= std::filesystem::copy_options::skip_existing;
4092-
}
4093-
40944085
std::function<bool(std::filesystem::path, std::filesystem::path)>
40954086
copy_dir_contents;
40964087
copy_dir_contents = [verbatim_symlinks,
40974088
&copy_dir_contents,
40984089
&env,
4099-
file_copy_opts,
41004090
preserve_timestamps,
41014091
force,
41024092
error_on_exist,

0 commit comments

Comments
 (0)