matthiaskrgr / matthiaskrgr/cargo-cache

stats_from_file_desc_list: dont manually zip list

Open
#60 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

refactor
Dominant language
Rust
Stars
994
Forks
26
PR merge metrics
No merged PRs in 30d

Description

use use x.iter().zip(x.iter().skip(1))

pub fn main() {
    let i = &[1, 2, 3, 4, 5, 6];

    i.iter()
        .zip(i.iter().skip(1))
        .for_each(|(a, b)| println!("{} {}", a, b));
}
1 2
2 3
3 4
4 5
5 6

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate stats_from_file_desc_list and inspect how it currently pairs adjacent entries. Compare that logic with the suggested iter().zip(iter().skip(1)) approach, then run the relevant existing checks or command to confirm the reported statistics and output remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.