Skip to content
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 opened this issue Jul 7, 2023 · 0 comments
Open

generate Rust file missing an keyword such as pub #57

cnzf1 opened this issue Jul 7, 2023 · 0 comments

Comments

@cnzf1
Copy link

cnzf1 commented Jul 7, 2023

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant