-
-
Notifications
You must be signed in to change notification settings - Fork 158
Replace PathBuf with FileEntry for LineEntry #203
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
Codecov Report
@@ Coverage Diff @@
## master #203 +/- ##
==========================================
+ Coverage 96.34% 96.87% +0.52%
==========================================
Files 14 14
Lines 1178 1377 +199
==========================================
+ Hits 1135 1334 +199
Misses 43 43
Continue to review full report at Codecov.
|
Signed-off-by: Mikhail Grachev <work@mgrachev.com>
| pub struct LineEntry { | ||
| pub number: usize, | ||
| pub file_path: PathBuf, | ||
| pub file: FileEntry, |
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.
This is a great solution!
But what do you think about the use of reference to FileEntry?
This will allow him not to clone and refer to 1 entity.
I look towards Rc<FileEntry> or reference with lifetime, but maybe this is not the best solution.
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.
It would be great, but right now I don't know how to implement it with less code.
Maybe I will do it later or you may help me with it 😉
What do you think about it?
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.
It would be great, but right now I don't know how to implement it with less code.
Maybe I will do it later or you may help me with it wink
What do you think about it?
Manually setting the lifetime really seems rather complicated in this case, Rc seems to be a faster option, but there are still a lot of changes in the code ...
I tried to implement everything on Rc and it's really big changes, but fortunately, all the tests pass, but I do not risk doing a pull request out of expediency 😱
I propose to accept your option and possibly revise it in future iterations if need.
✔ Checklist: