Skip to content

Combining let statements into a pattern #10651

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

Open
Kixiron opened this issue Oct 27, 2021 · 0 comments · May be fixed by #19777
Open

Combining let statements into a pattern #10651

Kixiron opened this issue Oct 27, 2021 · 0 comments · May be fixed by #19777
Labels
A-assists C-feature Category: feature request S-actionable Someone could pick this issue up and work on it right now

Comments

@Kixiron
Copy link
Member

Kixiron commented Oct 27, 2021

A nice little code action would be combining multiple let statements into a single one, like this

// Original code
let mut body = builder.translate(theta.body());
let mut outputs = BTreeMap::new();

// Code action turns it into this
let (mut body, mut outputs) = (builder.translate(theta.body()), BTreeMap::new());

The inverse would also be cool, splitting patterns into multiple bindings

@lnicola lnicola added A-assists C-feature Category: feature request S-actionable Someone could pick this issue up and work on it right now labels Oct 27, 2021
A4-Tacks added a commit to A4-Tacks/rust-analyzer that referenced this issue May 11, 2025
@A4-Tacks A4-Tacks linked a pull request May 11, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-assists C-feature Category: feature request S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants