Skip to content

Commit 24f9048

Browse files
authored
Refactor error handling in file copy logic
1 parent 0fd8712 commit 24f9048

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

libsql-ffi/build.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,12 @@ fn copy_with_cp(from: impl AsRef<Path>, to: impl AsRef<Path>) -> io::Result<()>
8989
{
9090
Ok(status) if status.success() => Ok(()),
9191
_ => match fs::copy(from.as_ref(), to.as_ref()) {
92-
Err(err) if err.kind() == io::ErrorKind::InvalidInput || err.kind() == io::ErrorKind::PermissionDenied => copy_dir_all(from, to),
92+
Err(err)
93+
if err.kind() == io::ErrorKind::InvalidInput
94+
|| err.kind() == io::ErrorKind::PermissionDenied =>
95+
{
96+
copy_dir_all(from, to),
97+
}
9398
Ok(_) => Ok(()),
9499
Err(err) => Err(err),
95100
},

0 commit comments

Comments
 (0)