Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

generate Rust file missing an keyword such as pub #57

Open
@cnzf1

Description

When I use JSON to Rust generate a file like below:

pub struct Record{
    #[serde(rename = "CODE")]
    code: String,

    #[serde(rename = "SECURITY_CODE")]
    security_code: String,

    #[serde(rename = "NAME")]
    name_abbr: String,
}

But, when I should access the field , I should get a error ,because of it is not visibility。I need a result like this:

pub struct Record{
    #[serde(rename = "CODE")]
    pub code: String,

    #[serde(rename = "SECURITY_CODE")]
    pub security_code: String,

    #[serde(rename = "NAME")]
    pub name_abbr: String,
}

If had a switch to control the soft , whether generate the keywork pub, it should be more perfect.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions