Skip to content

CacheKey constructor should take Request by reference #24353

Closed

Description

@jdm

In CacheKey's new method in http_cache.rs it takes a Request argument by value, but then it calls a method on it that only needs a borrowed value. We clone request objects every time we call CacheKey::new, and this is wasteful.

Code: components/net/http_cache.rs

No need to run tests; if it builds, that's good enough for a pull request.

Activity

  1. added
    E-less-complex
    I-cleanup
    on Oct 3, 2019
  2. highfive commented on Oct 3, 2019

    @highfive

    Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the #servo channel in IRC.

    If you intend to work on this issue, then add @highfive: assign me to your comment, and I'll assign this to you. 😄

  3. Tugdual commented on Oct 3, 2019

    @Tugdual
    Contributor

    @highfive: assign me

  4. added
    C-assigned
    on Oct 3, 2019
  5. highfive commented on Oct 3, 2019

    @highfive

    Hey @Tugdual! Thanks for your interest in working on this issue. It's now assigned to you!

  6. PeaceRebel commented on Oct 3, 2019

    @PeaceRebel
    Contributor

    @jdm , I'm new to rust. Instead of cloning, passing a reference would get it done, right?

  7. jdm commented on Oct 3, 2019

    @jdm
    MemberAuthor

    @PeaceRebel Yes, that is what I suggested. It looks like @Tugdual is working on this, however.

  8. added a commit that references this issue on Oct 5, 2019
    1318ea9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-networkC-assignedE-less-complexI-cleanup

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions