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

Removes set_no_remove_on_drop() from AppendVec/AccountsFile #32742

Merged
merged 1 commit into from
Aug 7, 2023

Conversation

brooksprumo
Copy link
Contributor

@brooksprumo brooksprumo commented Aug 7, 2023

Problem

The set_no_remove_on_drop() method on AppendVec and AccountsFile is unused (and should not be used). It should be removed.

Summary of Changes

Remove the methods.

@brooksprumo brooksprumo added the work in progress This isn't quite right yet label Aug 7, 2023
@brooksprumo brooksprumo self-assigned this Aug 7, 2023
@codecov
Copy link

codecov bot commented Aug 7, 2023

Codecov Report

Merging #32742 (47e1718) into master (6eea38d) will decrease coverage by 0.1%.
Report is 4 commits behind head on master.
The diff coverage is 99.6%.

@@            Coverage Diff            @@
##           master   #32742     +/-   ##
=========================================
- Coverage    82.0%    81.9%   -0.1%     
=========================================
  Files         785      785             
  Lines      211192   211175     -17     
=========================================
- Hits       173200   173149     -51     
- Misses      37992    38026     +34     

@brooksprumo brooksprumo force-pushed the remove-on-drop/method branch from d7fda30 to 47e1718 Compare August 7, 2023 17:26
@brooksprumo brooksprumo removed the work in progress This isn't quite right yet label Aug 7, 2023
@brooksprumo brooksprumo marked this pull request as ready for review August 7, 2023 18:02
Copy link
Contributor

@yhchiang-sol yhchiang-sol left a comment

Choose a reason for hiding this comment

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

Thanks for making the code logic cleaner!

Comment on lines -61 to -69
/// By default, all AccountsFile will remove its underlying file on
/// drop. Calling this function to disable such behavior for this
/// instance.
pub fn set_no_remove_on_drop(&mut self) {
match self {
Self::AppendVec(av) => av.set_no_remove_on_drop(),
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Love it!

@brooksprumo brooksprumo merged commit df31bc1 into solana-labs:master Aug 7, 2023
@brooksprumo brooksprumo deleted the remove-on-drop/method branch August 7, 2023 21:48
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.

2 participants