From 7ef1b5d4db47673198f5f36203be24cd50eece96 Mon Sep 17 00:00:00 2001 From: Jay Chia Date: Fri, 6 Oct 2023 15:17:23 -0700 Subject: [PATCH] windows compile --- src/daft-io/src/local.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/daft-io/src/local.rs b/src/daft-io/src/local.rs index ad1e02aaea..2172dd8ea7 100644 --- a/src/daft-io/src/local.rs +++ b/src/daft-io/src/local.rs @@ -1,4 +1,3 @@ -use std::borrow::Cow; use std::io::SeekFrom; use std::ops::Range; use std::path::PathBuf; @@ -148,14 +147,16 @@ impl ObjectSource for LocalSource { // Ensure fanout_limit is None because Local ObjectSource does not support prefix listing let fanout_limit = None; let page_size = None; - let glob_path = Cow::Borrowed(glob_path); // If on Windows, the delimiter provided may be "\" which is treated as an escape character by `glob` // We sanitize our filepaths here but note that on-return we will be received POSIX-style paths as well #[cfg(target_env = "msvc")] - let glob_path = Cow::Owned(glob_path.replace("\\", "/")); + { + glob_path = glob_path.replace("\\", "/"); + return glob(self, glob_path.as_str(), fanout_limit, page_size).await; + } - glob(self, glob_path.as_ref(), fanout_limit, page_size).await + glob(self, glob_path, fanout_limit, page_size).await } async fn ls(