Skip to content

Replace uses of for foo in bar.iter() and for foo in bar.iter_mut() #7197

Closed

Description

@Manishearth

for foo in bar.iter() can always be replaced with for foo in &bar, often even for foo in bar. With iter_mut we should use &mut bar

We do this a lot throughout Servo, see https://manishearth.pastebin.mozilla.org/8842698

It's advisable to do this with sed or some other tool, but manually fixing them works too (that way you can check if the for foo in bar method will work)

Activity

  1. added
    E-less-complex
    I-cleanup
    on Aug 13, 2015
  2. jxs commented on Aug 14, 2015

    @jxs
    Contributor

    i can also take this one if no one else is on it

  3. jdm commented on Aug 14, 2015

    @jdm
    Member

    It's yours!

  4. added
    C-assigned
    on Aug 14, 2015
  5. added a commit that references this issue on Aug 15, 2015
    0038580
  6. added a commit that references this issue on Aug 15, 2015
    a1b3f47
  7. added a commit that references this issue on Aug 18, 2015
  8. added a commit that references this issue on Aug 18, 2015
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

    C-assignedE-less-complexI-cleanup

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions