Skip to content

Code action to convert between struct types #19666

@oriongonza

Description

@oriongonza
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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions