-
Notifications
You must be signed in to change notification settings - Fork 60
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
Conversation
There was a problem hiding this 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.
kernel/src/snapshot.rs
Outdated
pub fn scan_builder(&self) -> ScanBuilder { | ||
ScanBuilder::new(self.clone()) | ||
} |
There was a problem hiding this comment.
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:
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
There was a problem hiding this comment.
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
There was a problem hiding this 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!
Co-authored-by: Nick Lanham <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Resolves #206