Skip to content

Commit

Permalink
Make .advance consume value
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Chia committed Oct 2, 2023
1 parent 57b8255 commit 428f1b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/daft-io/src/glob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl GlobState {
&self.glob_fragments[self.current_fragment_idx]
}

pub fn advance(&self, path: String, idx: usize) -> Self {
pub fn advance(self, path: String, idx: usize) -> Self {
GlobState {
current_path: path,
current_fragment_idx: idx,
Expand Down
7 changes: 5 additions & 2 deletions src/daft-io/src/object_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ pub(crate) async fn glob(
result_tx.clone(),
source.clone(),
// Do not increment `current_fragment_idx` so as to keep visiting the "**" fragmemt
state.advance(
state.clone().advance(
fm.filepath.clone(),
state.current_fragment_idx,
),
Expand Down Expand Up @@ -311,6 +311,7 @@ pub(crate) async fn glob(
result_tx.clone(),
source.clone(),
state
.clone()
.advance(fm.filepath, state.current_fragment_idx + 1)
.with_wildcard_mode(),
);
Expand All @@ -330,7 +331,9 @@ pub(crate) async fn glob(
visit(
result_tx.clone(),
source.clone(),
state.advance(full_dir_path, state.current_fragment_idx + 1),
state
.clone()
.advance(full_dir_path, state.current_fragment_idx + 1),
);
}
});
Expand Down

0 comments on commit 428f1b3

Please sign in to comment.