-
-
Notifications
You must be signed in to change notification settings - Fork 158
Use Rc for LineEntry to reduce memory consumption #393
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
Conversation
|
I was wondering how to enforce that I found this which recommended adding a private field to the struct. clippy warned against this, using non_exhaustive instead, but I found this only works at the crate level. So what's most 'idiomatic'? I'm not sure where to go from here (but that's really irrelevant to this PR!). |
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.
@Tom01098 👋 Thank you for your contribution 🚀
I have left some comments. Please take a look at them 👀
I like more the way where you can create a public pub struct LineEntry {
pub number: usize,
pub file: Rc<FileEntry>,
pub raw_string: String,
/// Used in ExtraBlankLineFixer
is_deleted: bool,
}This struct you can't create like this If you want to deal with the private field you can create a method like this: pub fn is_deleted(&self) -> bool {
self.is_deleted
} |
Co-authored-by: Grachev Mikhail <work@mgrachev.com>
Codecov Report
@@ Coverage Diff @@
## master #393 +/- ##
==========================================
+ Coverage 95.32% 95.57% +0.25%
==========================================
Files 37 37
Lines 2376 2375 -1
==========================================
+ Hits 2265 2270 +5
+ Misses 111 105 -6
Continue to review full report at Codecov.
|
|
@mgrachev thanks for the review, I should have corrected everything as requested. (If only I remembered conventional commits didn't end with a full stop I wouldn't have to keep force pushing!!) |
|
@Tom01098 Thank you for your help ❤️ |
Closes #388.
✔ Checklist: