Skip to content

Adjust struct naming #2

@teamplayer3

Description

@teamplayer3

Use structure types as in rust structures.

NewType as in new type idiom.

Match to serde ast style

// unit struct     -> Style::Unit
struct A;

// new type struct -> Style::Newtype
struct B(u8);

// tuple struct    -> Style::Tuple
struct C(u8, u16);

// struct (c-like) -> Style::Struct
struct D {
    a: u8,
    b: u16,
}

// enum
enum E {
    A,            // unit struct                     -> unit variant     -> Style::Unit
    B(u8),        // new type struct/ tuple struct   -> new type variant -> Style::Newtype
    C(u8, u16),   // tuple struct                    -> tple variant     -> Style::Tuple
    D {           // struct (c-like)                 -> struct variant   -> Style::Struct
        a: u8,
        b: u16
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions