Skip to content

Commit

Permalink
Maybe get Windows builds working?
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Saveau <[email protected]>
  • Loading branch information
SUPERCILEX committed Jul 14, 2024
1 parent 19d9853 commit 4dcbf3e
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions fuc_engine/src/ops/copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,6 @@ mod compat {
};

struct Impl {
#[allow(dead_code)]
follow_symlinks: bool,
}

Expand All @@ -625,15 +624,8 @@ mod compat {
impl DirectoryOp<(Cow<'_, Path>, Cow<'_, Path>)> for Impl {
#[cfg_attr(feature = "tracing", tracing::instrument(level = "trace", skip(self)))]
fn run(&self, (from, to): (Cow<Path>, Cow<Path>)) -> Result<(), Error> {
copy_dir(
&from,
to,
#[cfg(unix)]
self.follow_symlinks,
#[cfg(unix)]
None,
)
.map_io_err(|| format!("Failed to copy directory: {from:?}"))
copy_dir(&from, to, self.follow_symlinks, None)
.map_io_err(|| format!("Failed to copy directory: {from:?}"))
}

#[cfg_attr(feature = "tracing", tracing::instrument(level = "trace", skip(self)))]
Expand All @@ -646,8 +638,8 @@ mod compat {
fn copy_dir<P: AsRef<Path> + Debug, Q: AsRef<Path> + Debug>(
from: P,
to: Q,
#[cfg(unix)] follow_symlinks: bool,
#[cfg(unix)] root_to_inode: Option<u64>,
#[allow(clippy::only_used_in_recursion)] follow_symlinks: bool,
#[allow(clippy::only_used_in_recursion)] root_to_inode: Option<u64>,
) -> Result<(), io::Error> {
let to = to.as_ref();
match fs::create_dir(to) {
Expand Down Expand Up @@ -691,7 +683,7 @@ mod compat {

#[cfg(not(unix))]
if file_type.is_dir() {
copy_dir(dir_entry.path(), to)?;
copy_dir(dir_entry.path(), to, follow_symlinks, root_to_inode)?;
} else {
fs::copy(dir_entry.path(), to)?;
}
Expand Down

0 comments on commit 4dcbf3e

Please sign in to comment.