-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Removed unused Borrow trait requirements #53
base: main
Are you sure you want to change the base?
Conversation
* Cache takes ownership of input data The cache example now owns the data, and not static references, as mentioned in al8n#48 Also variable names are modified to explain their usage. * Update sync_example.rs The cache example now owns the data, and not static references, as mentioned in al8n#48 Also variable names are modified to explain their usage.
While reviewing the code I was a confused by the name num_entries which suggest an integer while actually a fractional number is used. Changing this to usize makes the function call 7 machine code instructions shorter and the function body longer 5 instructions longer (from 65 to 70, as checked by the compiler explorer https://godbolt.org/ ). So with improved code readability also 2 instructions less are needed.
…odifying field of interest (al8n#52)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #53 +/- ##
==========================================
- Coverage 85.74% 85.40% -0.34%
==========================================
Files 17 17
Lines 1831 1830 -1
==========================================
- Hits 1570 1563 -7
- Misses 261 267 +6 ☔ View full report in Codecov by Sentry. |
Thanks! But I just found that if we remove the borrow limit, we are unable to limit the Basically, I think we can add a new kind of Cache, which only requires a generic for Value, and in that kind cache, we remove the borrow limitation there and accept any kind of key. |
Okay, I leave the choice to you. |
fde836e
to
cccb12b
Compare
A single character contribution.
As mentioned in #50 question 1, the unused Borrow trait requirements are removed. Some other code is aligned using rustfmt --edition 2021