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 <saveau.alexandre@gmail.com>
  • Loading branch information
SUPERCILEX committed Jul 14, 2024
1 parent 19d9853 commit b28102c
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 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>,
follow_symlinks: bool,
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,8 @@ mod compat {

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

0 comments on commit b28102c

Please sign in to comment.