Skip to content
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

stats_from_file_desc_list: dont manually zip list #60

Open
matthiaskrgr opened this issue Jul 20, 2019 · 0 comments
Open

stats_from_file_desc_list: dont manually zip list #60

matthiaskrgr opened this issue Jul 20, 2019 · 0 comments
Labels
refactor code that could use a refactoring

Comments

@matthiaskrgr
Copy link
Owner

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
@matthiaskrgr matthiaskrgr added the refactor code that could use a refactoring label Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor code that could use a refactoring
Projects
None yet
Development

No branches or pull requests

1 participant