rust-analyzer
rust-analyzer copied to clipboard
Add new assist to convert for loop with while let
Application
With this assist the users can convert their for to while let so that they can iterate their list manually.
For example, we have a text that we iterate by its iterator. If we come across the word a, then we are waiting for b after that, so we skip the iterator:
fn main() {
let v = [1, 2, 3, 4];
let mut v = v.into_iter();
while let Some(x) = v.next() {
if x == "a" {
v.skip(1);
}
}
}
Cool!!
:umbrella: The latest upstream changes (presumably #13091) made this pull request unmergeable. Please resolve the merge conflicts.
Can you remove the merge commits of the PR please? (Either by rebasing somehow or opening a new PR with the changes on a new branch) These merge commits create a lot of noise in the commit graph otherwise.
:umbrella: The latest upstream changes (presumably #13935) made this pull request unmergeable. Please resolve the merge conflicts.
Closing this due to inactivity, feel free to re-open should you come back to it.