rust-lang / rust-lang/rust-analyzer

Code action to convert between struct types

Open
#19,666 7 comments 0 reactions 1 assignee View on GitHub

@asukaminato0721 is already working on this.

Since Nov 28, 2025.

A-assists C-feature E-easy
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

struct S {} // Convert into unit struct
struct S; // Convert into normal struct

struct S { field: String }; // Convert into tuple struct
struct S(String); // Convert into normal struct

struct S(String, u64); // Convert into normal struct
struct S { 
  field_1: String, // These can be renamed easily later on
  field_2: u64
}

I think that this would aid in refactoring in a big way, especially for tuple -> named structs.

It's a pain to fix them manually.

Contributor guide

Open the contributing guide

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.