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

Use itertools #127

Merged
merged 1 commit into from
Sep 13, 2024
Merged

Conversation

marxin
Copy link
Sponsor Contributor

@marxin marxin commented Sep 12, 2024

In the future, we might want to use the following function: rust-itertools/itertools#934.

@davidlattimore
Copy link
Owner

I generally try to avoid putting partially inferred types (e.g. Vec<_>) on variables, since then rust-analyzer doesn't show the full type inline. e.g. in here we can see that files is a Vec<FileLayout<'data>>

image

But with a partial type, we can't:

image

Not a massive problem, but that's why I tend to use the turbofish perhaps more than some other people. I'm not strongly opposed to doing it with partially inferred types if you really want to though - I can still get the inferred type if I hover, it's just not always there like it is for a fully inferred type.

@marxin
Copy link
Sponsor Contributor Author

marxin commented Sep 13, 2024

Sure, I fully understand your point. I've removed all the try_collect calls from the PR.

@marxin marxin changed the title Use itertools (collect_vec, try_collect) Use itertools Sep 13, 2024
@davidlattimore davidlattimore merged commit 90d3cd5 into davidlattimore:main Sep 13, 2024
3 checks passed
@marxin marxin deleted the use-more-itertools branch September 13, 2024 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants