Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scan_builder function added to Snapshot #273

Merged
merged 8 commits into from
Jul 11, 2024

Conversation

sherlockbeard
Copy link
Contributor

Resolves #206

Copy link
Collaborator

@nicklan nicklan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just a small suggestion on the api.

Comment on lines 255 to 257
pub fn scan_builder(&self) -> ScanBuilder {
ScanBuilder::new(self.clone())
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think we shouldn't #[derive(Clone)] and then clone ourselves. That's somewhat surprising to a user. Instead, let's implement it for Arc, and add an into_scan_builder() that consumes the snapshot:

Suggested change
pub fn scan_builder(&self) -> ScanBuilder {
ScanBuilder::new(self.clone())
}
pub fn scan_builder(self: Arc<Self>) -> ScanBuilder {
ScanBuilder::new(self)
}
pub fn into_scan_builder(self) -> ScanBuilder {
ScanBuilder::new(self)
}

You'll need to import Arc for this to work. Also please remove the derives for Clone

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok added scan_builder, into_scan_builder

Copy link
Collaborator

@nicklan nicklan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just please two small documentation fixes! Thanks!

kernel/src/snapshot.rs Outdated Show resolved Hide resolved
kernel/src/snapshot.rs Show resolved Hide resolved
@nicklan nicklan requested a review from sppalkia July 9, 2024 22:40
@nicklan nicklan requested a review from hntd187 July 11, 2024 20:38
Copy link
Collaborator

@hntd187 hntd187 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@hntd187 hntd187 merged commit ebd8e37 into delta-io:main Jul 11, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a scan_builder() method to Snapshot
3 participants