Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upCacheKey constructor should take Request by reference #24353
Closed
Labels
Comments
|
Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the If you intend to work on this issue, then add |
|
@highfive: assign me |
|
Hey @Tugdual! Thanks for your interest in working on this issue. It's now assigned to you! |
|
@jdm , I'm new to rust. Instead of cloning, passing a reference would get it done, right? |
|
@PeaceRebel Yes, that is what I suggested. It looks like @Tugdual is working on this, however. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In CacheKey's
newmethod inhttp_cache.rsit takes aRequestargument by value, but then it calls a method on it that only needs a borrowed value. We clone request objects every time we callCacheKey::new, and this is wasteful.Code:
components/net/http_cache.rsNo need to run tests; if it builds, that's good enough for a pull request.